does Pulumi have a way to index/iterate over a set...
# general
o
does Pulumi have a way to index/iterate over a set of resources? I.e. GCLB routing rules.... figuring out how to make that a Pulumi resource/object that can be referenced as [0], [1] etc Terraform has the concept of 'count'
s
You can just create an array - one of the benefits of a ‘real’ language!
👍 3
To be more descriptive here, I often find myself doing things like:
Copy code
const cidrs = ["10.0.1.0/24", "10.0.2.0/24"]

const publicSubnets = cirds.map((cidr, index) => {
    return new aws.ec2.Subnet(`subnet-${index}`, {
         vpcId: "soemthing",
         cidrBlock: cidr
    });
});