pulumi / pulumi-awsx

AWS infrastructure best practices in component form!
https://www.pulumi.com/docs/guides/crosswalk/aws/
Apache License 2.0
218 stars 106 forks source link

Tags added to subnet resource after creation of subnet do not get added #1345

Closed pierskarsenbarg closed 2 weeks ago

pierskarsenbarg commented 1 month ago

What happened?

If you create a VPC using this:

const vpc = new awsx.ec2.Vpc(`vpc-${stackName}`, {
  numberOfAvailabilityZones: 3,
  subnetSpecs: [
    {
      type: awsx.ec2.SubnetType.Public,
      name: "public",
    },
    {
        type: awsx.ec2.SubnetType.Private,
        name: "private"
    }
  ],
  natGateways: {
    strategy: "Single"
  },
  subnetStrategy: "Auto",
  tags: {
    "stackName": stackName,
    "owner": "piers"
  }
});

and then add in tags to one of the subnets later:

const vpc = new awsx.ec2.Vpc(`vpc-${stackName}`, {
  numberOfAvailabilityZones: 3,
  subnetSpecs: [
    {
      type: awsx.ec2.SubnetType.Public,
      name: "public",
      tags: {
        "kubernetes.io/role/elb": "1",
      },
    },
    {
        type: awsx.ec2.SubnetType.Private,
        name: "private"
    }
  ],
  natGateways: {
    strategy: "Single"
  },
  subnetStrategy: "Auto",
  tags: {
    "stackName": stackName,
    "owner": "piers"
  }
});

(this is so I can use the ALB controller) then the kubernetes.io/role/elb tag does not get added to the actual subnets in AWS.

Output of pulumi about

CLI          
Version      3.111.1
Go Version   go1.22.1
Go Compiler  gc

Plugins
NAME    VERSION
aws     6.44.0
awsx    2.13.0
docker  4.5.4
docker  3.6.1
nodejs  unknown

Host     
OS       darwin
Version  14.5
Arch     arm64

Dependencies:
NAME            VERSION
@pulumi/aws     6.44.0
@pulumi/awsx    2.13.0
@pulumi/pulumi  3.124.0
@types/node     18.19.39
typescript      5.5.3

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

corymhall commented 1 month ago

@pierskarsenbarg I tried to reproduce the issue using your example and I can see the tags on the subnets in the AWS console.

The only difference I can see is that I ran it using version 3.124.0 of the pulumi CLI.

t0yv0 commented 2 weeks ago

This issue got stale and we can't reproduce so I'm closing - @pierskarsenbarg please feel free to ping us if you're still having trouble here.