pulumi-aws-native icon indicating copy to clipboard operation
pulumi-aws-native copied to clipboard

Default tags always generate a diff

Open fitz-vivodyne opened this issue 10 months ago • 1 comments

What happened?

I added a couple default tags as enabled by https://github.com/pulumi/pulumi-aws-native/pull/1369. Unfortunately, these default tags generate a diff on every preview/apply as it apparently expects the tags to be ordered.

Example

https://github.com/fitz-vivodyne/pulumi-native-tagging-issue.

Every time you run pulumi preview you get a diff due to tag ordering

Previewing update (dev):
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:pulumi:Stack::pulumi-native-aws-tagging-issue-dev]                                               ~ aws-native:s3:Bucket: (update)
        [id=bucket-12f04d5]
        [urn=urn:pulumi:dev::pulumi-native-aws-tagging-issue::aws-native:s3:Bucket::bucket]
      ~ tags: [
          ~ [0]: {
                  ~ key  : "tag1" => "Tag4"
                  ~ value: "a" => "d"
                }
          ~ [1]: {
                  ~ key  : "tag2" => "Tag1"
                  ~ value: "b" => "a"
                }
          ~ [2]: {
                  ~ key  : "tag3" => "Tag2"
                  ~ value: "c" => "b"
                }
          + [3]: {
                  + key  : "Tag3"
                  + value: "c"
                }
        ]
Resources:
    ~ 1 to update
    1 unchanged

Output of pulumi about

CLI
Version 3.108.1 Go Version go1.22.0 Go Compiler gc

Plugins NAME VERSION aws-native unknown yaml unknown

Host
OS darwin Version 14.3 Arch arm64

This project is written in yaml

Current Stack: organization/pulumi-native-aws-tagging-issue/dev

TYPE URN pulumi:pulumi:Stack urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:pulumi:Stack::pulumi-native-aws-tagging-issue-dev pulumi:providers:aws-native urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:providers:aws-native::default aws-native:s3:Bucket urn:pulumi:dev::pulumi-native-aws-tagging-issue::aws-native:s3:Bucket::bucket

Found no pending operations associated with dev

Backend
Name ip-192-168-50-8.ec2.internal URL s3://fitz-tissue-viewer-testing?region=us-east-2 User fitz Organizations
Token type personal

No dependencies found

Pulumi locates its logs in /var/folders/cq/yr41qnrs4rg9363y3yp4f1f40000gn/T/ by default

Additional context

If you disable default tags and tag an item manually it works fine, only fails if default tags are set at the provider level.

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).

fitz-vivodyne avatar Apr 16 '24 17:04 fitz-vivodyne

That sounds very unfortunate, thanks for bringing it to our attention! Will have a look as time permits.

t0yv0 avatar Apr 17 '24 13:04 t0yv0