> **Experimental**
>
> `@aws-cdk/app-staging-synthesizer-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# BootstrapRole

Bootstrapped role specifier.

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

Obtainable from: BootstrapRole.cliCredentials, BootstrapRole.fromRoleArn

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/bootstrap-roles.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/app-staging-synthesizer-alpha/lib/bootstrap-roles.ts#L8)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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")
        })
    })
});
```

Golang:

```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` (static) — Use the currently assumed role/credentials.

- `fromRoleArn(arn: string): BootstrapRole // chainable` (static) — Specify an existing IAM Role to assume.

- `isCliCredentials(): boolean` — Whether or not this is object was created using BootstrapRole.cliCredentials().
