Skip to content

Terraform assuming EC2 role instead of ECS role #24253

@vinujan59

Description

@vinujan59

I can confirm that ECS container which is running the terraform has the environmental variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI

Terraform Version

v0.12.21

Terraform Configuration Files

dev-backend-config
bucket=""
key=""
region=""

command - terraform init -backend-config="dev-backend-config"

Debug Output

2020/03/03 11:46:52 [INFO] ECS container credentials detected, RemoteCredProvider added to auth chain
2020/03/03 11:46:52 [INFO] AWS EC2 instance detected via default metadata API endpoint, EC2RoleProvider added to the auth chain
2020/03/03 11:46:53 [INFO] AWS Auth provider used: "EC2RoleProvider

Crash Output

Expected Behavior

Terraform should assume role assigned to ECS task

Actual Behavior

Terraform is assuming EC2 role

Steps to Reproduce

Additional Context

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions