Skip to content
v2.278.0

Experimental

@aws-cdk/app-staging-synthesizer-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

BootstrapRole Class ​

Bootstrapped role specifier.

These roles must exist already. This class does not create new IAM Roles.

Example ​

ts
import { BucketEncryption } from 'aws-cdk-lib/aws-s3';

const app = new App({
  defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
    appId: 'my-app-id',
    stagingBucketEncryption: BucketEncryption.S3_MANAGED,
    deploymentIdentities: DeploymentIdentities.specifyRoles({
      cloudFormationExecutionRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Execute'),
      deploymentRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Deploy'),
      lookupRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Lookup'),
    }),
  }),
});
python
from aws_cdk.aws_s3 import BucketEncryption


app = App(
    default_stack_synthesizer=AppStagingSynthesizer.default_resources(
        app_id="my-app-id",
        staging_bucket_encryption=BucketEncryption.S3_MANAGED,
        deployment_identities=DeploymentIdentities.specify_roles(
            cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
            deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
            lookup_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Lookup")
        )
    )
)
java
import software.amazon.awscdk.services.s3.BucketEncryption;


App app = App.Builder.create()
        .defaultStackSynthesizer(AppStagingSynthesizer.defaultResources(DefaultResourcesOptions.builder()
                .appId("my-app-id")
                .stagingBucketEncryption(BucketEncryption.S3_MANAGED)
                .deploymentIdentities(DeploymentIdentities.specifyRoles(BootstrapRoles.builder()
                        .cloudFormationExecutionRole(BootstrapRole.fromRoleArn("arn:aws:iam::123456789012:role/Execute"))
                        .deploymentRole(BootstrapRole.fromRoleArn("arn:aws:iam::123456789012:role/Deploy"))
                        .lookupRole(BootstrapRole.fromRoleArn("arn:aws:iam::123456789012:role/Lookup"))
                        .build()))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AppStagingSynthesizer.Alpha
using Amazon.CDK.AWS.S3;


var app = new App(new AppProps {
    DefaultStackSynthesizer = AppStagingSynthesizer.DefaultResources(new DefaultResourcesOptions {
        AppId = "my-app-id",
        StagingBucketEncryption = BucketEncryption.S3_MANAGED,
        DeploymentIdentities = DeploymentIdentities.SpecifyRoles(new BootstrapRoles {
            CloudFormationExecutionRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Execute"),
            DeploymentRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Deploy"),
            LookupRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Lookup")
        })
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/appstagingsynthesizeralpha/v2
import "github.com/aws/aws-cdk-go/awscdk"


app := awscdk.NewApp(&AppProps{
	DefaultStackSynthesizer: appstagingsynthesizeralpha.AppStagingSynthesizer_DefaultResources(&DefaultResourcesOptions{
		AppId: jsii.String("my-app-id"),
		StagingBucketEncryption: awscdk.BucketEncryption_S3_MANAGED,
		DeploymentIdentities: appstagingsynthesizeralpha.DeploymentIdentities_SpecifyRoles(&BootstrapRoles{
			CloudFormationExecutionRole: appstagingsynthesizeralpha.BootstrapRole_FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Execute")),
			DeploymentRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Deploy")),
			LookupRole: appstagingsynthesizeralpha.BootstrapRole_*FromRoleArn(jsii.String("arn:aws:iam::123456789012:role/Lookup")),
		}),
	}),
})

Methods ​

cliCredentials(): BootstrapRole // chainable@staticmethod def cli_credentials() -> BootstrapRolepublic static BootstrapRole cliCredentials()public static BootstrapRole CliCredentials()func CliCredentials() BootstrapRole static #
Use the currently assumed role/credentials.
fromRoleArn(arn: string): BootstrapRole // chainable@staticmethod def from_role_arn(arn: str) -> BootstrapRolepublic static BootstrapRole fromRoleArn(String arn)public static BootstrapRole FromRoleArn(string arn)func FromRoleArn(Arn *string) BootstrapRole static #
Specify an existing IAM Role to assume.
isCliCredentials(): booleandef is_cli_credentials(self, ) -> boolpublic Boolean isCliCredentials()public bool IsCliCredentials()func IsCliCredentials() *bool #
Whether or not this is object was created using BootstrapRole.cliCredentials().