Class GitHubActionRole
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- io.github.cdklabs.cdkpipelines.github.GitHubActionRole
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.62.0 (build 293ac17)", date="2022-07-16T00:20:23.451Z") @Stability(Stable) public class GitHubActionRole extends software.constructs.Construct
Creates or references a GitHub OIDC provider and accompanying role that trusts the provider.This role can be used to authenticate against AWS instead of using long-lived AWS user credentials stored in GitHub secrets.
You can do this manually in the console, or create a separate stack that uses this construct. You must
cdk deployonce (with your normal AWS credentials) to have this role created for you.You can then make note of the role arn in the stack output and send it into the Github Workflow app via the
gitHubActionRoleArnproperty. The role arn will bearn:aws:iam::<accountId>:role/GithubActionRole.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGitHubActionRole.BuilderA fluent builder forGitHubActionRole.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGitHubActionRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedGitHubActionRole(software.amazon.jsii.JsiiObjectRef objRef)GitHubActionRole(software.constructs.Construct scope, String id, GitHubActionRoleProps props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static software.amazon.awscdk.services.iam.IOpenIdConnectProviderexistingGitHubActionsProvider(software.constructs.Construct scope)Reference an existing GitHub Actions provider.software.amazon.awscdk.services.iam.IRolegetRole()The role that gets created.-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
GitHubActionRole
protected GitHubActionRole(software.amazon.jsii.JsiiObjectRef objRef)
-
GitHubActionRole
protected GitHubActionRole(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
GitHubActionRole
@Stability(Stable) public GitHubActionRole(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GitHubActionRoleProps props)- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Detail
-
existingGitHubActionsProvider
@Stability(Stable) @NotNull public static software.amazon.awscdk.services.iam.IOpenIdConnectProvider existingGitHubActionsProvider(@NotNull software.constructs.Construct scope)Reference an existing GitHub Actions provider.You do not need to pass in an arn because the arn for such a provider is always the same.
- Parameters:
scope- This parameter is required.
-
getRole
@Stability(Stable) @NotNull public software.amazon.awscdk.services.iam.IRole getRole()
The role that gets created.You should use the arn of this role as input to the
gitHubActionRoleArnproperty in your GitHub Workflow app.
-
-