pulumi / pulumi-awsx

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

provider does not support importing resources #1300

Open chainlink opened 3 months ago

chainlink commented 3 months ago

What happened?

Attempting to import a resource created using the awsx module.

Example

pulumi import awsx:ecr/Repository:repository backend-repo backend-repo-f0dd567

reports error

Preview failed: provider does not support importing resources; please try updating the 'awsx' plugin

Output of pulumi about

Version      3.113.3
Go Version   go1.22.2
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  aws         6.38.1
resource  awsx        2.9.0
resource  docker      4.5.4
resource  eks         2.3.0
resource  kubernetes  4.13.1
language  python      unknown

Host     
OS       darwin
Version  14.5
Arch     arm64

This project is written in python: executable='/Users/kyle/mzai/mzai-platform/infra/ci/venv/bin/python3' version='3.9.7'

TYPE                           URN
pulumi:pulumi:Stack            urn:pulumi:dev-ci::pulumi-aws::pulumi:pulumi:Stack::pulumi-aws-dev-ci
pulumi:providers:aws           urn:pulumi:dev-ci::pulumi-aws::pulumi:providers:aws::default_6_38_1
aws:ecr/repository:Repository  urn:pulumi:dev-ci::pulumi-aws::aws:ecr/repository:Repository::backend-repo-new

Found no pending operations associated with dev-ci

Backend        
Name           pulumi.com
URL            xxx
User           xxx
Organizations  xxx
Token type     personal

Dependencies:
NAME         VERSION
pip          24.0
pulumi_awsx  2.9.0
pulumi_eks   2.3.0
setuptools   70.0.0
wheel        0.43.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).

flostadler commented 3 months ago

Hey @chainlink, I'm sorry you're running into this issue. The components in awsx do not support importing them.

As a workaround you can import the underlying resources using the aws classic provider. Right now (v2.9.0) for the ECR repository component these are:

benjy44 commented 2 months ago

Just to clarify, it's possible to use the awsx provider and import each underlying resources, one simple way is to run: pulumi preview --import-file my_ressources.json

Update the ID for each resource in the json file (and the ID required can be found in the AWS classic provider doc for that resource), then: pulumi import -f my_ressources.json