-
Notifications
You must be signed in to change notification settings - Fork 0
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
DR2-2007 Remove mgmt terraform roles and use account ones. #38
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "AllowAccountAccess", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": ${terraform_role_arns} | ||
}, | ||
"Action": [ | ||
"dynamodb:DescribeTable", | ||
"dynamodb:DeleteItem", | ||
"dynamodb:GetItem", | ||
"dynamodb:PutItem" | ||
], | ||
"Resource": "${table_arn}" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,23 @@ | |
"arn:aws:iam::${account_id}:policy/${environment_title}*", | ||
"arn:aws:iam::${account_id}:instance-profile/${environment}*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"dynamodb:DescribeTable", | ||
"dynamodb:DeleteItem", | ||
"dynamodb:GetItem", | ||
"dynamodb:PutItem", | ||
"s3:GetObject", | ||
"s3:ListBucket", | ||
"s3:PutObject" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:s3:::mgmt-dp-terraform-state", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it fine that we're hardcoding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, there's only one state bucket and it's in the management account. |
||
"arn:aws:s3:::mgmt-dp-terraform-state/*", | ||
"arn:aws:dynamodb:eu-west-2:${management_account_id}:table/mgmt-dp-terraform-state-lock" | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "Allow account roles access", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": ${terraform_role_arns} | ||
}, | ||
"Action": [ | ||
"s3:GetObject", | ||
"s3:ListBucket", | ||
"s3:PutObject" | ||
], | ||
"Resource": [ | ||
"arn:aws:s3:::mgmt-dp-terraform-state", | ||
"arn:aws:s3:::mgmt-dp-terraform-state/*" | ||
] | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the source be adding to a local variable since it's used 4 times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried it, terraform won't let you. A lot of people want it but they say no.