Class StackProps.Builder

java.lang.Object
software.amazon.awscdk.core.StackProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<StackProps>
Enclosing interface:
StackProps

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

    • Builder

      public Builder()
  • Method Details

    • analyticsReporting

      @Stability(Stable) public StackProps.Builder analyticsReporting(Boolean analyticsReporting)
      Parameters:
      analyticsReporting - Include runtime versioning information in this Stack.
      Returns:
      this
    • description

      @Stability(Stable) public StackProps.Builder description(String description)
      Sets the value of StackProps.getDescription()
      Parameters:
      description - A description of the stack.
      Returns:
      this
    • env

      @Stability(Stable) public StackProps.Builder env(Environment env)
      Sets the value of StackProps.getEnv()
      Parameters:
      env - The AWS environment (account/region) where this stack will be deployed. Set the region/account fields of env to either a concrete value to select the indicated environment (recommended for production stacks), or to the values of environment variables CDK_DEFAULT_REGION/CDK_DEFAULT_ACCOUNT to let the target environment depend on the AWS credentials/configuration that the CDK CLI is executed under (recommended for development stacks).

      If the Stack is instantiated inside a Stage, any undefined region/account fields from env will default to the same field on the encompassing Stage, if configured there.

      If either region or account are not set nor inherited from Stage, the Stack will be considered "environment-agnostic"". Environment-agnostic stacks can be deployed to any environment but 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 such as ec2.Vpc.fromLookup and will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements.

      Returns:
      this
    • stackName

      @Stability(Stable) public StackProps.Builder stackName(String stackName)
      Sets the value of StackProps.getStackName()
      Parameters:
      stackName - Name to deploy the stack with.
      Returns:
      this
    • synthesizer

      @Stability(Stable) public StackProps.Builder synthesizer(IStackSynthesizer synthesizer)
      Sets the value of StackProps.getSynthesizer()
      Parameters:
      synthesizer - Synthesis method to use while deploying this stack.
      Returns:
      this
    • tags

      @Stability(Stable) public StackProps.Builder tags(Map<String,String> tags)
      Sets the value of StackProps.getTags()
      Parameters:
      tags - Stack tags that will be applied to all the taggable resources and the stack itself.
      Returns:
      this
    • terminationProtection

      @Stability(Stable) public StackProps.Builder terminationProtection(Boolean terminationProtection)
      Parameters:
      terminationProtection - Whether to enable termination protection for this stack.
      Returns:
      this
    • build

      @Stability(Stable) public StackProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<StackProps>
      Returns:
      a new instance of StackProps
      Throws:
      NullPointerException - if any required attribute was not provided