Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags not read when importing with defaultTags #3311

Closed
Fydon opened this issue Jan 24, 2024 · 2 comments · Fixed by #4169
Closed

Tags not read when importing with defaultTags #3311

Fydon opened this issue Jan 24, 2024 · 2 comments · Fixed by #4169
Assignees
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@Fydon
Copy link

Fydon commented Jan 24, 2024

What happened?

I set aws.Provider's defaultTags and then tried some imports. Some work, but some are failing as it claims that tags don't match in spite of tags being present.

For AWS Backup Plans, calling aws backup get-backup-plan does not return tags (doc). To get tags, aws backup list-tags needs to be called (doc). Even though I've set the tags on a backup plan, it won't import because it claims the tags are missing. Using the above commands, I can get the tags so they are set. Could the underlying code be failing to perform the extra step to get tags when importing?

I'm experiencing the same problem with Backup Vaults and Roles. For Vaults, aws backup describe-backup-vault (doc) doesn't return tags but again aws backup list-tags does. For Roles, aws iam get-role does return tags.

After experiencing this problem, I removed defaultTags but then had to remove the tags to allow the import to proceed.

Example

To keep this simple, I'll just provide the vault

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const provider = new aws.Provider(
  'provider-us-east-1',
  {
    defaultTags: {
      tags: {
        'pulumi:project': pulumi.getProject(),
        'pulumi:stack': pulumi.getStack(),
      },
    },
    profile: 'aws',
    region: 'us-east-1',
  }
);

const vault = new aws.backup.Vault(
  'productionVault',
  {
    name: 'production',
  },
  {
    import: 'production',
    parent: provider,
    provider,
  }
);

Output of pulumi about

CLI
Version      3.102.0
Go Version   go1.21.5
Go Compiler  gc

Plugins
NAME    VERSION
aws     6.18.2
nodejs  unknown

Host
OS       Microsoft Windows 11 Pro
Version  10.0.22631 Build 22631
Arch     x86_64

This project is written in nodejs: executable='C:\Program Files\nodejs\node.exe' version='v16.15.0'

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

@Fydon Fydon added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 24, 2024
@iwahbe iwahbe added area/import An issue related to `pulumi import` or the import resource option. and removed needs-triage Needs attention from the triage team labels Jan 25, 2024
@iwahbe
Copy link
Member

iwahbe commented Jan 25, 2024

Hi @Fydon. Thanks for letting us know about this issue. I appreciate the clear repro.

@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #4169 and shipped in release v6.45.2.

@mjeffryes mjeffryes added this to the 0.108 milestone Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants