aws-cdk-lib.StageProps

interface StageProps

LanguageType name
.NETAmazon.CDK.StageProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2#StageProps
Javasoftware.amazon.awscdk.StageProps
Pythonaws_cdk.StageProps
TypeScript (source)aws-cdk-lib » StageProps

Initialization props for a stage.

Example

declare const app: App;

new Stage(app, 'DevStage');

new Stage(app, 'BetaStage', {
  permissionsBoundary: PermissionsBoundary.fromName('beta-permissions-boundary'),
});

new Stage(app, 'GammaStage', {
  permissionsBoundary: PermissionsBoundary.fromName('prod-permissions-boundary'),
});

new Stage(app, 'ProdStage', {
  permissionsBoundary: PermissionsBoundary.fromName('prod-permissions-boundary'),
});

Properties

NameTypeDescription
env?EnvironmentDefault AWS environment (account/region) for Stacks in this Stage.
outdir?stringThe output directory into which to emit synthesized artifacts.
permissionsBoundary?PermissionsBoundaryOptions for applying a permissions boundary to all IAM Roles and Users created within this Stage.
policyValidationBeta1?IPolicyValidationPluginBeta1[]Validation plugins to run during synthesis.
stageName?stringName of this stage.

env?

Type: Environment (optional, default: The environments should be configured on the Stacks.)

Default AWS environment (account/region) for Stacks in this Stage.

Stacks defined inside this Stage with either region or account missing from its env will use the corresponding field given here.

If either region or accountis is not configured for Stack (either on the Stack itself or on the containing Stage), the Stack will be environment-agnostic.

Environment-agnostic stacks can be deployed to any environment, may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups, will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements. Example

// Use a concrete account and region to deploy this Stage to
new Stage(app, 'Stage1', {
  env: { account: '123456789012', region: 'us-east-1' },
});

// Use the CLI's current credentials to determine the target environment
new Stage(app, 'Stage2', {
  env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
});

outdir?

Type: string (optional, default: for nested stages, outdir will be determined as a relative directory to the outdir of the app. For apps, if outdir is not specified, a temporary directory will be created.)

The output directory into which to emit synthesized artifacts.

Can only be specified if this stage is the root stage (the app). If this is specified and this stage is nested within another stage, an error will be thrown.


permissionsBoundary?

Type: PermissionsBoundary (optional, default: no permissions boundary is applied)

Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.


policyValidationBeta1?

Type: IPolicyValidationPluginBeta1[] (optional, default: no validation plugins are used)

Validation plugins to run during synthesis.

If any plugin reports any violation, synthesis will be interrupted and the report displayed to the user.


stageName?

Type: string (optional, default: Derived from the id.)

Name of this stage.