# BootstrapRole

Information needed to access an IAM role created as part of the bootstrap process.

- Source: [`lib/cloud-assembly/artifact-schema.ts`](https://github.com/aws/aws-cdk-cli/blob/HEAD/packages/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.ts)
- Type last changed: v2.160.0 · 24 Sep 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';

declare const assumeRoleAdditionalOptions: any;
const bootstrapRole: cloud_assembly_schema.BootstrapRole = {
  arn: 'arn',

  // the properties below are optional
  assumeRoleAdditionalOptions: {
    assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
  },
  assumeRoleExternalId: 'assumeRoleExternalId',
  bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
  requiresBootstrapStackVersion: 123,
};
```

Python:

```python
from aws_cdk.cloud_assembly_schema import BootstrapRole
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

# assume_role_additional_options: Any

bootstrap_role = BootstrapRole(
    arn="arn",

    # the properties below are optional
    assume_role_additional_options={
        "assume_role_additional_options_key": assume_role_additional_options
    },
    assume_role_external_id="assumeRoleExternalId",
    bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter",
    requires_bootstrap_stack_version=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;

Object assumeRoleAdditionalOptions;

BootstrapRole bootstrapRole = BootstrapRole.builder()
        .arn("arn")

        // the properties below are optional
        .assumeRoleAdditionalOptions(Map.of(
                "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions))
        .assumeRoleExternalId("assumeRoleExternalId")
        .bootstrapStackVersionSsmParameter("bootstrapStackVersionSsmParameter")
        .requiresBootstrapStackVersion(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var assumeRoleAdditionalOptions;

var bootstrapRole = new BootstrapRole {
    Arn = "arn",

    // the properties below are optional
    AssumeRoleAdditionalOptions = new Dictionary<string, object> {
        { "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions }
    },
    AssumeRoleExternalId = "assumeRoleExternalId",
    BootstrapStackVersionSsmParameter = "bootstrapStackVersionSsmParameter",
    RequiresBootstrapStackVersion = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assumeRoleAdditionalOptions interface{}

bootstrapRole := &BootstrapRole{
	Arn: jsii.String("arn"),

	// the properties below are optional
	AssumeRoleAdditionalOptions: map[string]interface{}{
		"assumeRoleAdditionalOptionsKey": assumeRoleAdditionalOptions,
	},
	AssumeRoleExternalId: jsii.String("assumeRoleExternalId"),
	BootstrapStackVersionSsmParameter: jsii.String("bootstrapStackVersionSsmParameter"),
	RequiresBootstrapStackVersion: jsii.Number(123),
}
```

## Properties

- `arn`: string (required) — The ARN of the IAM role created as part of bootrapping e.g. lookupRoleArn.

- `assumeRoleAdditionalOptions`: { [key: string]: any } — Additional options to pass to STS when assuming the role.

  **Default:** No additional options.

  - `RoleArn` should not be used. Use the dedicated `arn` property instead.
  - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.

- `assumeRoleExternalId`: string — External ID to use when assuming the bootstrap role.

  **Default:** No external ID

- `bootstrapStackVersionSsmParameter`: string — Name of SSM parameter with bootstrap stack version.

  **Default:** Discover SSM parameter by reading stack

- `requiresBootstrapStackVersion`: number — Version of bootstrap stack required to use this role.

  **Default:** No bootstrap stack required
