This message was deleted.
# golang
s
This message was deleted.
s
This is subnet bring up I have used but also tried creating subnets without the loop
Copy code
subCount := 0
		for sub, cidr := range subs {
			_, err = ec2.NewSubnet(ctx, sub, &ec2.SubnetArgs{
				VpcId:                                vpc.ID(),
				CidrBlock:                            pulumi.String(cidr),
				AvailabilityZone:                     pulumi.String(azs[subCount]),
				EnableResourceNameDnsARecordOnLaunch: pulumi.BoolPtr(true),
				MapPublicIpOnLaunch:                  pulumi.BoolPtr(true),
				Tags: pulumi.StringMap{
					"Name": pulumi.String(sub),
				},
			},
				pulumi.DependsOn([]pulumi.Resource{vpc}),
			)
			subCount++
			if err != nil {
				return err
			}
		}
b
Making changes is supported, what error do you get?
s
It says failed to create the subnets - what is happening is, it doesn’t look to modify the subnet but rather re-create it and with the CIDR taken for subnet, it fails
b
s
that helps, will try adding this.
This worked after adding for provider, thanks @billowy-army-68599