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

DR2-2007 Remove mgmt terraform roles and use account ones. #38

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

MancunianSam
Copy link
Contributor

This deletes the management roles which assumed the roles in the
environment accounts and updates the trust policies on those accounts to
allow GitHub to run them.

It also updates the bucket policy for the state bucket and the resource
policy for the lock table.

This will need nationalarchives/da-terraform-modules#82 to be merged
before this can be deployed.

This deletes the management roles which assumed the roles in the
environment accounts and updates the trust policies on those accounts to
allow GitHub to run them.

It also updates the bucket policy for the state bucket and the resource
policy for the lock table.
Copy link
Contributor

@techncl techncl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just 2 minor comments

],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::mgmt-dp-terraform-state",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it fine that we're hardcoding mgmt here and below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

terraform_external_id = module.terraform_config.terraform_config["intg"]["terraform_external_id"]
terraform_github_role_arn = module.terraform_github_terraform_environments["intg"].role_arn
management_developer_role_arn = data.aws_ssm_parameter.dev_admin_role.value
source = "./environment_roles"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@techncl techncl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@MancunianSam MancunianSam merged commit 232c1c5 into main Dec 5, 2024
1 check passed
@MancunianSam MancunianSam deleted the DR2-2007-use-account-roles-for-terraform branch December 5, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants