Class Stage.Builder

java.lang.Object
software.amazon.awscdk.Stage.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Stage>
Enclosing class:
Stage

@Stability(Stable) public static final class Stage.Builder extends Object implements software.amazon.jsii.Builder<Stage>
A fluent builder for Stage.
  • Method Details

    • create

      @Stability(Stable) public static Stage.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Stage.Builder.
    • env

      @Stability(Stable) public Stage.Builder env(Environment env)
      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.

      Default: - The environments should be configured on the `Stack`s.

      Example:

       // Use a concrete account and region to deploy this Stage to
       // Use a concrete account and region to deploy this Stage to
       Stage.Builder.create(app, "Stage1")
               .env(Environment.builder().account("123456789012").region("us-east-1").build())
               .build();
       // Use the CLI's current credentials to determine the target environment
       // Use the CLI's current credentials to determine the target environment
       Stage.Builder.create(app, "Stage2")
               .env(Environment.builder().account(process.getEnv().getCDK_DEFAULT_ACCOUNT()).region(process.getEnv().getCDK_DEFAULT_REGION()).build())
               .build();
       

      Parameters:
      env - Default AWS environment (account/region) for Stacks in this Stage. This parameter is required.
      Returns:
      this
    • outdir

      @Stability(Stable) public Stage.Builder outdir(String outdir)
      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.

      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.

      Parameters:
      outdir - The output directory into which to emit synthesized artifacts. This parameter is required.
      Returns:
      this
    • permissionsBoundary

      @Stability(Stable) public Stage.Builder permissionsBoundary(PermissionsBoundary permissionsBoundary)
      Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.

      Default: - no permissions boundary is applied

      Parameters:
      permissionsBoundary - Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. This parameter is required.
      Returns:
      this
    • policyValidationBeta1

      @Stability(Stable) public Stage.Builder policyValidationBeta1(List<? extends IPolicyValidationPluginBeta1> policyValidationBeta1)
      Validation plugins to run during synthesis.

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

      Default: - no validation plugins are used

      Parameters:
      policyValidationBeta1 - Validation plugins to run during synthesis. This parameter is required.
      Returns:
      this
    • stageName

      @Stability(Stable) public Stage.Builder stageName(String stageName)
      Name of this stage.

      Default: - Derived from the id.

      Parameters:
      stageName - Name of this stage. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Stage build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Stage>
      Returns:
      a newly built instance of Stage.