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

terraform issue when dealing with cross account access #1192

Closed
rico-spaceship opened this issue Jul 20, 2017 · 3 comments
Closed

terraform issue when dealing with cross account access #1192

rico-spaceship opened this issue Jul 20, 2017 · 3 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@rico-spaceship
Copy link

rico-spaceship commented Jul 20, 2017

Hi there,

We are having issues with spinning up ec2 instance in a cross account setup.

Terraform Version

0.9.11

Affected Resource(s)

EC2 instances

Terraform Configuration Files

We created a role from our Dev account, and allow our corp account to assume this role
see this gist : https://gist.github.com/rico-spaceship/d0f1ac24381ae7bbbc5c9591a919ade6
From our corp account, we attach a policy to assume the role:
https://gist.github.com/rico-spaceship/68b9855a5e9506f681f9627d5f7b71be

Then when we try to launch our ec2 instance, we wrap it up in a shell script:
https://gist.github.com/rico-spaceship/68101bffe7baef56eb2193384fb31a0d

Debug Output

It seems that we can do the terraform -init with the backend s3 bucket, but it throws some error when we try to run the script.

[05:14:10]	[Step 1/1] 2017/07/20 05:14:10 [ERROR] root: eval: *terraform.EvalConfigProvider, err: InvalidClientTokenId: The security token included in the request is invalid.
[05:14:10]	[Step 1/1] status code: 403, request id: xxxxxxxxxxxxxxxxxxxxxxx
[05:14:10]	[Step 1/1] 2017/07/20 05:14:10 [ERROR] root: eval: *terraform.EvalSequence, err: InvalidClientTokenId: The security token included in the request is invalid.
[05:14:10]	[Step 1/1] status code: 403, request id: xxxxxxxxxxxxxxxxxxxxxxx
[05:14:10]	[Step 1/1] 2017/07/20 05:14:10 [ERROR] root: eval: *terraform.EvalOpFilter, err: InvalidClientTokenId: The security token included in the request is invalid.
[05:14:10]	[Step 1/1] status code: 403, request id: xxxxxxxxxxxxxxxx
[05:14:10]	[Step 1/1] 2017/07/20 05:14:10 [ERROR] root: eval: *terraform.EvalSequence, err: InvalidClientTokenId: The security token included in the request is invalid.
[05:14:10]	[Step 1/1] status code: 403, request id: xxxxxxxxxxxxxxxx
[05:14:10]	[Step 1/1] 2017/07/20 05:14:10 [TRACE] [walkRefresh] Exiting eval tree: provider.aws
[05:14:12]	[Step 1/1] Error refreshing state: 1 error(s) occurred:
[05:14:12]	[Step 1/1]
[05:14:12]	[Step 1/1] * provider.aws: InvalidClientTokenId: The security token included in the request is invalid.
[05:14:12]	[Step 1/1] status code: 403, request id: xxxxxxxxxxxxxxxx

Expected Behavior

"terraform apply" can spin up the issue without throwing issues

Actual Behavior

"terraform apply" failed

@agarstang
Copy link

Mentioned in #2693 on the Terraform repo that the role_arn parameter on the AWS provider probably fits this use case (therefore no need for wrapper shell script).

@Ninir Ninir added the bug Addresses a defect in current functionality. label Jul 26, 2017
@radeksimko radeksimko added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 28, 2018
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Mar 30, 2020
@ghost
Copy link

ghost commented May 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

4 participants