Comments (1)
Parameters:
GitHubOrg:
Type: String
RepositoryName:
Type: String
EnvironmentName:
Default: ''
Type: String
OIDCProviderArn:
Description: Arn for the GitHub OIDC Provider.
Default: ''
Type: String
Conditions:
CreateOIDCProvider: !Equals
- Ref: OIDCProviderArn
- ''
UseEnvironment: !Equals
- Ref: EnvironmentName
- ''
Resources:
Role:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Action: 'sts:AssumeRoleWithWebIdentity'
Principal:
Federated: !If
- CreateOIDCProvider
- !Ref GithubOidc
- !Ref OIDCProviderArn
Condition:
StringLike:
'token.actions.githubusercontent.com:sub': !If
- UseEnvironment
- !Sub >-
repo:${GitHubOrg}/${RepositoryName}:environment:${EnvironmentName}
- !Sub 'repo:${GitHubOrg}/${RepositoryName}:*'
Policies:
- PolicyName: CDKAssumeRole
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: sts:AssumeRole
Resource: !Sub arn:aws:iam::${AWS::AccountId}:role/cdk-*
GithubOidc:
Type: 'AWS::IAM::OIDCProvider'
Condition: CreateOIDCProvider
Properties:
Url: 'https://token.actions.githubusercontent.com'
ClientIdList:
- sts.amazonaws.com
ThumbprintList:
- 6938fd4d98bab03faadb97b34396831e3780aea1
Outputs:
Role:
Value: !GetAtt Role.Arn
from repo-sandbox.
Related Issues (20)
- Cleanup environments on PR close / merge
- Simultenous updates; how does GH actions handle 2 commits in quick succession? HOT 1
- Cache teiring HOT 1
- PR concurrency not working
- Avoid re-deploy if nothing changed HOT 3
- Handle shared PR resources
- Get CDK output to PR comments HOT 3
- Handle deployment of multiple apps HOT 1
- Handle dynamic configuration (CDK => REACT) HOT 1
- ELIFECYCLE Command failed with exit code 143. HOT 2
- Fix pr-close SHA calculation
- Configuring different environments HOT 4
- Does updating the lock file cause a re-build/re-deploy of everything? HOT 4
- Label
- Delete cloudfront for PRs
- BucketDeployment is painfully slow
- Handle PR changes that previously resulted in a deployment HOT 1
- Per-pull request environments
- Prettify CDK/test output on PRs HOT 2
- Deploy based on PR label
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repo-sandbox.