sparse-intern-71089
03/10/2023, 9:00 PMbillowy-army-68599
billowy-army-68599
broad-parrot-2692
03/10/2023, 9:05 PMthis should work okay, what do you want the end result to be?Thank you for taking the time to respond! The above codeblock works just fine, the problem is I now need to create A records in this zone, and that involves referencing the zone I've just created. I could just type the name of the zone as a string, but then the dependency chain would be broken.
broad-parrot-2692
03/10/2023, 9:05 PMalso - you might want to make this a component!I will look into this! I'm not immediately sure what you mean though
billowy-army-68599
billowy-army-68599
broad-parrot-2692
03/10/2023, 9:09 PMbroad-parrot-2692
03/10/2023, 9:11 PMAh, i see, do you want to add different records to each zone, so you want to have them stored that way?I'm sorry, I'm having a little trouble understanding what you mean by "So you want to have them stored that way". I do want to add a variety of DNS records to each zone. Should I just manually declare the dependency? It seems like the wrong thing to do since I do need the output from the zone declaration, so I might as well be looking for ways to capture the output from the
forEach
loop. I'll definitely be running into this problem laterbillowy-army-68599
zones.forEach((zone) => {
// somehow declare const here to work with the output zone name and establish deps?
const myZone = new gcp.dns.ManagedZone(zone.name, zone.args, zone.opts);
new gcp.dns.RecordSet("foo", {
name: "<http://foo.nuggies.life|foo.nuggies.life>"
managedZone: myZone.id
type: "A",
ttl: 300,
rrdatas: ["8.8.8.8"],
});
}
billowy-army-68599
append
or such like in the forEach
billowy-army-68599
broad-parrot-2692
03/10/2023, 9:14 PMconst myZone
be set twice? (one per zone created)broad-parrot-2692
03/10/2023, 9:14 PMbroad-parrot-2692
03/10/2023, 9:14 PMbillowy-army-68599
billowy-army-68599
broad-parrot-2692
03/10/2023, 9:16 PMyou can just append the id to a new data structure and loop over thatThis makes sense! My brain has been pretty fried over this for a minute, but that should work perfectly.
broad-parrot-2692
03/10/2023, 9:17 PMbillowy-army-68599
broad-parrot-2692
03/11/2023, 1:31 AM