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

Issue if not supplying profile, and attempting to use env vars for aws access key and secret key #1898

Open
Lewiscowles1986 opened this issue Jul 11, 2024 · 1 comment

Comments

@Lewiscowles1986
Copy link

Hey, thanks for the cool software.

Something strange (to me); is that this seems to require me to setup AWS in a specific way (using profiles).

I set this up on a vanilla machine and attempted to use the following env variables:

  • AWS_DEFAULT_REGION
  • AWS_REGION
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

My provider.tf

provider "aws" {
  region = "eu-west-1"  # Change to your desired region
}

Finally, I ran with the command terraformer import aws --resources=cognito --regions=eu-west-1

This did not work, and raised this error:

lewiscowles@Lewiss-MacBook-Air cognito-okta % terraformer import aws --resources=cognito --regions=eu-west-1
2024/07/11 05:48:19 aws importing region eu-west-1
2024/07/11 05:48:21 aws importing... cognito
2024/07/11 05:48:25 aws error initializing resources in service cognito, err: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, exceeded maximum number of attempts, 3, request send failed, Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: host is down
2024/07/11 05:48:25 aws Connecting....

@Lewiscowles1986
Copy link
Author

For-now fix is to run aws configure, and fill in the details so a default profile is present. Meh, I guess it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant