Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. # ~/.aws/credentials
  2. [root]
  3. aws_access_key_id = xxxx
  4. aws_secret_access_key = xxxx
  5.  
  6. # ~/.aws/config
  7. [profile myprofile]
  8. role_arn = arn:aws:iam::xxxxxxxxxx:role/role-to-read-state-file
  9. source_profile = root
  10.  
  11. # config.tf
  12. terraform {
  13. backend "s3" {
  14. bucket = "terraform-bucket"
  15. key = "statefile"
  16. region = "eu-west-2"
  17. profile = "myprofile"
  18. }
  19.  
  20. required_version = "= 0.11.14"
  21. }
  22.  
  23. # works locally and on ec2 amazonlinux2 instance
  24. aws s3 ls s3://state-file-bucket --profile myprofile
  25.  
  26. # works locally
  27. terraform init
  28.  
  29. # doesn't work on a ec2 amazonlinux2 instance
  30. terraform init
  31. Failed to get existing workspaces: AccessDenied: Access Denied
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement