https://pulumi.com logo
#golang
Title
# golang
s

stocky-sundown-45608

08/29/2022, 8:34 AM
I am provisioning EKS with Pulumi, to setup the platform I am also bringing up VPC using Pulumi and Go SDKs. VPC Provisioning along with subnets works as expected, however making any changes to the stack, for example changing the subnet settings (dns enabled), ends up trying to create a new subnet and fails. Coming from terraform, shouldn’t changes to provisioned resources be supported?
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

billowy-army-68599

08/29/2022, 2:42 PM
Making changes is supported, what error do you get?
s

stocky-sundown-45608

08/29/2022, 3:16 PM
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

billowy-army-68599

08/29/2022, 3:19 PM
s

stocky-sundown-45608

08/29/2022, 3:24 PM
that helps, will try adding this.
This worked after adding for provider, thanks @billowy-army-68599
4 Views