-
Notifications
You must be signed in to change notification settings - Fork 0
[NDR-387] Rationalise GitHub Role files #637
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
Merged
Merged
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
bfb30d2
[ndr-387] Added interim grouped tf files
tim-knight-nhs f95fedd
[ndr-387] formatting applied
tim-knight-nhs 414b7af
[ndr-387] removed hard ref to dev
tim-knight-nhs 6bba36a
[ndr-398] renames files
tim-knight-nhs e24b86e
[ndr-387] forced sorted output
tim-knight-nhs ba72295
[ndr-387] fix sorting for consistent build
tim-knight-nhs 467ad29
[ndr-387] Update explodify.py to sort permissions by resource, condit…
tim-knight-nhs 185d69c
[ndr-387] updated sort order
tim-knight-nhs f111155
[ndr-387] split common file to avoid size limit
tim-knight-nhs e323f0d
[ndr-387] linting
tim-knight-nhs c0bad9f
[ndr-387] added comments and better naming of split policies
tim-knight-nhs f63a61a
[ndr-387] renamed policy documents
tim-knight-nhs b9355c2
[ndr-387] merged a couple of rules into one
tim-knight-nhs 408ed8c
[ndr-387] merged variants into shared file
tim-knight-nhs 09efdb6
[ndr-387] remove old export files
tim-knight-nhs db1b229
[ndr-387] removed repeated config
tim-knight-nhs 604a68a
[ndr-387] removed OLD files
tim-knight-nhs 0988966
[ndr-386] renamed main tf files. removed NEW
tim-knight-nhs 3ec1c88
[ndr-387] removed stale comment
tim-knight-nhs 144ced0
[ndr-387] removed repeated permissions
tim-knight-nhs fb19d75
[ndr-387] moved states permissions to common file
tim-knight-nhs 585451d
[ndr-387] reverting test changes
tim-knight-nhs f284431
[ndr-387] adding ReadOnlyAccess policy to all
tim-knight-nhs cb565b3
[ndr-387] removed count for global permissions
tim-knight-nhs 227b4e1
[ndr-387] formatting
tim-knight-nhs d0f8b49
[ndr-387] removed index on permis
tim-knight-nhs 2b08c10
[ndr-387] renamed dev_test_pre-prod_prod to common
tim-knight-nhs 9b4502b
[ndr-387] comments and rename
tim-knight-nhs 6690bcf
[ndr-387] remove padding
tim-knight-nhs 1827025
[ndr-387] formatting clean-up
tim-knight-nhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| resource "aws_iam_role" "github_actions" { | ||
| name = "${terraform.workspace}-github-actions-role" | ||
| description = "This role provides access for GitHub Actions to the ${terraform.workspace} environment. " | ||
| force_detach_policies = false | ||
| max_session_duration = 3600 | ||
| name_prefix = null | ||
| path = "/" | ||
| permissions_boundary = null | ||
| tags = {} | ||
| assume_role_policy = local.is_sandbox_or_dev ? jsonencode( | ||
| { | ||
| Statement = [ | ||
| { | ||
| Action = "sts:AssumeRoleWithWebIdentity" | ||
| Condition = { | ||
| StringEquals = { | ||
| "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com" | ||
| } | ||
| StringLike = { | ||
| "token.actions.githubusercontent.com:sub" = [ | ||
| "repo:NHSDigital/national-document-repository-infrastructure:*", | ||
| "repo:NHSDigital/national-document-repository:*", | ||
| ] | ||
| } | ||
| } | ||
| Effect = "Allow" | ||
| Principal = { | ||
| Federated = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:oidc-provider/token.actions.githubusercontent.com" | ||
| } | ||
| }, | ||
| { | ||
| Action = "sts:AssumeRole" | ||
| Effect = "Allow" | ||
| Principal = { | ||
| AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/aws-reserved/sso.amazonaws.com/eu-west-2/AWSReservedSSO_DomainCGpit-Administrators_e00623801cb4b59e" | ||
| } | ||
| }, | ||
| ] | ||
| Version = "2012-10-17" | ||
| } | ||
| ) : jsonencode( | ||
| { | ||
| Statement = [ | ||
| { | ||
| Action = "sts:AssumeRoleWithWebIdentity" | ||
| Condition = { | ||
| StringEquals = { | ||
| "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com" | ||
| } | ||
| StringLike = { | ||
| "token.actions.githubusercontent.com:sub" = [ | ||
| "repo:NHSDigital/national-document-repository-infrastructure:*", | ||
| "repo:NHSDigital/national-document-repository:*", | ||
| ] | ||
| } | ||
| } | ||
| Effect = "Allow" | ||
| Principal = { | ||
| Federated = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:oidc-provider/token.actions.githubusercontent.com" | ||
| } | ||
| }, | ||
| ] | ||
| Version = "2012-10-17" | ||
| } | ||
| ) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.