Normally I run Terragrunt locally using an IAM role and this works great.
I’ve started adding a CI job to a repo but when setting the AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID env variables I get access denied while initializing remote state for the s3 backend when doing terragrunt init.
Reading the README again under the “Work with multiple AWS accounts” section, option 3 says setting these variables should work. I can view the bucket contents with the variables set using the aws command and sync contents both ways. I can also do terraform init and specific the bucket and path without an error.
Is there something I can do to troubleshoot this? I’m using Terraform v0.11.7 and Terragrunt v0.14.10.
root@b527fdbd796f:/builds/project-1/dir$ terragrunt init
[terragrunt] [/builds/project-1/dir] 2018/06/15 12:15:26 Running command: terraform --version
[terragrunt] 2018/06/15 12:15:26 Reading Terragrunt config file at /builds/project-1/dir/terraform.tfvars
[terragrunt] 2018/06/15 12:15:26 Initializing remote state for the s3 backend
[terragrunt] 2018/06/15 12:15:27 AccessDenied: Access Denied
status code: 403, request id: 9762866593D8ED3E, host id: fC+o2S/OFjOTGqVeuMefX/rO9DT2Ixp8wDOgCbxb1G6FiPwjfUpIYXKPMz8eaaWXx0J8ZcyrZ1E=
[terragrunt] 2018/06/15 12:15:27 Unable to determine underlying exit code, so Terragrunt will exit with error code 1
When I terraform init:
root@b527fdbd796f:/builds/project-1/dir$ terraform init
Initializing the backend...
bucket
The name of the S3 bucket
Enter a value: xxxbucketxxx
key
The path to the state file inside the bucket
Enter a value: xxxbucketxxx/xxxpathxxx/terraform.tfstate
region
The region of the S3 bucket.
Enter a value: xxx
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Is it possible Terragrunt is trying to do something extra that causes it to fail? For now I’ve created a default profile and using that.