Skip to content

Commit

Permalink
feat: add cloudfront for prod github live action
Browse files Browse the repository at this point in the history
  • Loading branch information
williamh890 committed Jul 16, 2024
1 parent 89c1ccb commit ad14d67
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions build/github-actions-oidc-edc-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
AWSTemplateFormatVersion: 2010-09-09
Description: GitHub OIDC for when GitHub wants to communicate with AWS EDC Test Account.

Resources:
# This is the bare-bones role.
GitHubActionsRole:
Type: AWS::IAM::Role
Properties:
RoleName: GitHub_Actions_Role_SearchUI_prod
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Federated: !Sub arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com
Action: sts:AssumeRoleWithWebIdentity
Condition:
StringLike:
'token.actions.githubusercontent.com:sub': ['repo:asfadmin/Discovery-SearchUI:*']
StringEqualsIgnoreCase:
'token.actions.githubusercontent.com:aud': sts.amazonaws.com
Policies:
- PolicyName: OidcSafetyPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: OidcSafeties
Effect: Deny
Action:
- sts:AssumeRole
Resource: "*"
- PolicyName: GitHubActionsDeployPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: AllowS3SyncActions
Effect: Allow
Action:
- s3:DeleteObject
- s3:GetBucketLocation
- s3:GetObject
- s3:ListBucket
- s3:PutObject
Resource:
- arn:aws:s3:::asf-search-ui-edc-prod
- arn:aws:s3:::asf-search-ui-edc-prod/*


# This is the OIDC provider hookup itself. This tells AWS to delegate authN GitHub
GitHubActionsOidcProvider:
Type: AWS::IAM::OIDCProvider
Properties:
ClientIdList:
- sts.amazonaws.com
ThumbprintList:
- 6938fd4d98bab03faadb97b34396831e3780aea1
Url: https://token.actions.githubusercontent.com

0 comments on commit ad14d67

Please sign in to comment.