sst / sst

Build full-stack apps on your own infrastructure.
https://sst.dev
MIT License
22.13k stars 1.68k forks source link

Ion migration Issue #4296

Closed oldschoolbg closed 3 months ago

oldschoolbg commented 3 months ago

(this has been raised before but was closed with no comments - Issue 48)

I am in the process of migrating from V2 to V3 (ion) and have been following the migration guide. When I attempt to start the new V3 sst I get the following error:

failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded.

My sst.config.ts is super simple:

export default $config({ app(input) { return { name: "honeycomb", removal: "retain", // input?.stage === "production" ? "retain" : "remove", home: "aws", providers: { aws: { region: 'eu-west-2' } } }; }, async run() {}, });

tsato1 commented 3 months ago

Do you have the credentials file in the .aws folder (https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html)?

I encountered this too. My fix was

  1. Create an IAM user under my aws account, create access key / secret
  2. Run 'aws configure' and input the access key / secret
  3. Confirm that there is access key / secret in the ~/.aws/credentials file

I was originally using aws account (not IAM user) and I realized that the sst ion document doesn't instruct us to create aws accounts as sst v2 document does. Instead, it instructs us to create an IAM user. So, I created an IAM user under my aws account

oldschoolbg commented 3 months ago

Hi thanks for the suggestion.

We use AWS SSO. Not sure how that interacts but that's a useful additional snippet about our setup I forgot to provide.

thdxr commented 3 months ago

you need to specify the profile in AWS_PROFILE=xxx env variable or pass itin the provider config

oldschoolbg commented 3 months ago

thank you - that worked. Much appreciate the help.