Interface Environment

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
Environment.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.032Z") @Stability(Stable) public interface Environment extends software.amazon.jsii.JsiiSerializable
The deployment environment for a stack.

Example:

 // Passing a replication bucket created in a different stack.
 App app = new App();
 Stack replicationStack = Stack.Builder.create(app, "ReplicationStack")
         .env(Environment.builder()
                 .region("us-west-1")
                 .build())
         .build();
 Key key = new Key(replicationStack, "ReplicationKey");
 Bucket replicationBucket = Bucket.Builder.create(replicationStack, "ReplicationBucket")
         // like was said above - replication buckets need a set physical name
         .bucketName(PhysicalName.GENERATE_IF_NEEDED)
         .encryptionKey(key)
         .build();
 // later...
 // later...
 Pipeline.Builder.create(replicationStack, "Pipeline")
         .crossRegionReplicationBuckets(Map.of(
                 "us-west-1", replicationBucket))
         .build();
 
  • Method Details

    • getAccount

      @Stability(Stable) @Nullable default String getAccount()
      The AWS account ID for this environment.

      This can be either a concrete value such as 585191031104 or Aws.accountId which indicates that account ID will only be determined during deployment (it will resolve to the CloudFormation intrinsic {"Ref":"AWS::AccountId"}). Note that certain features, such as cross-stack references and environmental context providers require concerete region information and will cause this stack to emit synthesis errors.

      Default: Aws.accountId which means that the stack will be account-agnostic.

    • getRegion

      @Stability(Stable) @Nullable default String getRegion()
      The AWS region for this environment.

      This can be either a concrete value such as eu-west-2 or Aws.region which indicates that account ID will only be determined during deployment (it will resolve to the CloudFormation intrinsic {"Ref":"AWS::Region"}). Note that certain features, such as cross-stack references and environmental context providers require concerete region information and will cause this stack to emit synthesis errors.

      Default: Aws.region which means that the stack will be region-agnostic.

    • builder

      @Stability(Stable) static Environment.Builder builder()
      Returns:
      a Environment.Builder of Environment