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

Terraformer Unable to use Profile assignment #1945

Open
UnaffiliatedCode opened this issue Oct 30, 2024 · 1 comment
Open

Terraformer Unable to use Profile assignment #1945

UnaffiliatedCode opened this issue Oct 30, 2024 · 1 comment

Comments

@UnaffiliatedCode
Copy link

Hello, there were previous attempts to re-open the following issue. I can confirm the issue exists in current release v0.8.24

terraformer --version
version v0.8.24

When looking at the AWS configuration file we can see the following:

[default]
[YOUR_ADMIN_PROFILE]
aws_access_key_id = REDACTED_KEY
aws_secret_access_key = REDACTED_SECRET
aws_session_token = REDACTED_TOKEN

This configuration will not work no matter how you attempt to execute the command (even with ENV VAR's), but the underlying AWS commands/terraform commands will succeed.

You have to change the config to the following, and utilize the default profile:

[default]
aws_access_key_id = REDACTED_KEY
aws_secret_access_key = REDACTED_SECRET
aws_session_token = REDACTED_TOKEN

Failed Command:

terraformer import aws --resources=vpc,subnet --profile "YOUR_ADMIN_PROFILE"

Successful command:

terraformer import aws --resources=vpc,subnet --profile ""

Example output:

$ terraformer import aws --resources=vpc --profile "YOUR_ADMIN_PROFILE"
2024/10/30 12:25:36 aws importing default region
2024/10/30 12:25:37 aws importing... vpc
2024/10/30 12:25:42 aws error initializing resources in service vpc, err: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded
$ terraformer import aws --resources=vpc --profile ""
2024/10/30 12:26:00 aws importing default region
2024/10/30 12:26:02 aws importing... vpc
2024/10/30 12:26:02 aws done importing vpc
2024/10/30 12:26:04 Filtered number of resources for service vpc: 2
2024/10/30 12:26:04 aws Connecting.... 
2024/10/30 12:26:04 aws save vpc
2024/10/30 12:26:04 aws save tfstate for vpc

This is related to the following: #940

@dmitrym0
Copy link

Confirming this behaviour. Setting profile to "" resolves auth issues.

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

2 participants