Hi all I have this issue where preview keeps faili...
# getting-started
Hi all I have this issue where preview keeps failing when I try to run command to import a resource into an existing pulumi stack. Here's the error
Copy code
Type                    Name    Plan    Info
pulumi: pulumi: Stack   dev             1 error
- aws:ebs:Volume        id      import  1 error

pulumi:pulumi:Stack (dev):

error: Preview failed: 1 error occurred:
* configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
AWS Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or "AWS_EC2_ METADATA DISABLED" environment variable
Any ideas why this might be happening please? I have run the import command on the cli to import an ebs volume, specifying the id of the resource.
pulumi import aws:ebs/volume:Volume id vol-id
and I am expecting a preview and some ts code that should be generated. Here's what I expect
Copy code
Previewing import (dev)

     Type                 Name        Plan
 +   pulumi:pulumi:Stack  dev         
 =   └─ aws:ebs:Volume     id         import

    + 1 to create
    = 1 to import
    2 changes

Do you want to perform this import?
> yes
This is a credentials issue. I've never seen it before so I don't know what causes it, but I've searched the internet and plenty of people have had it and resolved it. You may need to refresh a token or change your provider.
Thanks for answering @little-cartoon-10569. Turns out I didn't set up my aws credentials properly. I have resolved the issue now.