Interface AppProps

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

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:18.316Z") @Stability(Stable) public interface AppProps extends software.amazon.jsii.JsiiSerializable
Initialization props for apps.

Example:

 import software.amazon.awscdk.services.s3.BucketEncryption;
 App app = App.Builder.create()
         .defaultStackSynthesizer(AppStagingSynthesizer.defaultResources(DefaultResourcesOptions.builder()
                 .appId("my-app-id")
                 .stagingBucketEncryption(BucketEncryption.S3_MANAGED)
                 .deploymentIdentities(DeploymentIdentities.cliCredentials())
                 .build()))
         .build();
 
  • Method Details

    • getAnalyticsReporting

      @Stability(Stable) @Nullable default Boolean getAnalyticsReporting()
      Include runtime versioning information in the Stacks of this app.

      Default: Value of 'aws:cdk:version-reporting' context key

    • getAutoSynth

      @Stability(Stable) @Nullable default Boolean getAutoSynth()
      Automatically call synth() before the program exits.

      If you set this, you don't have to call synth() explicitly. Note that this feature is only available for certain programming languages, and calling synth() is still recommended.

      Default: true if running via CDK CLI (`CDK_OUTDIR` is set), `false` otherwise

    • getContext

      @Stability(Stable) @Nullable default Map<String,Object> getContext()
      Additional context values for the application.

      Context set by the CLI or the context key in cdk.json has precedence.

      Context can be read from any construct using node.getContext(key).

      Default: - no additional context

    • getDefaultStackSynthesizer

      @Stability(Stable) @Nullable default IReusableStackSynthesizer getDefaultStackSynthesizer()
      The stack synthesizer to use by default for all Stacks in the App.

      The Stack Synthesizer controls aspects of synthesis and deployment, like how assets are referenced and what IAM roles to use. For more information, see the README of the main CDK package.

      Default: - A `DefaultStackSynthesizer` with default settings

    • getOutdir

      @Stability(Stable) @Nullable default String getOutdir()
      The output directory into which to emit synthesized artifacts.

      You should never need to set this value. By default, the value you pass to the CLI's --output flag will be used, and if you change it to a different directory the CLI will fail to pick up the generated Cloud Assembly.

      This property is intended for internal and testing use.

      Default: - If this value is _not_ set, considers the environment variable `CDK_OUTDIR`. If `CDK_OUTDIR` is not defined, uses a temp directory.

    • getPolicyValidationBeta1

      @Stability(Stable) @Nullable default List<IPolicyValidationPluginBeta1> getPolicyValidationBeta1()
      Validation plugins to run after synthesis.

      Default: - no validation plugins

    • getPostCliContext

      @Stability(Stable) @Nullable default Map<String,Object> getPostCliContext()
      Additional context values for the application.

      Context provided here has precedence over context set by:

      • The CLI via --context
      • The context key in cdk.json
      • The AppProps.context property

      This property is recommended over the AppProps.context property since you can make final decision over which context value to take in your app.

      Context can be read from any construct using node.getContext(key).

      Default: - no additional context

      Example:

       // context from the CLI and from `cdk.json` are stored in the
       // CDK_CONTEXT env variable
       Object cliContext = JSON.parse(process.getEnv().getCDK_CONTEXT());
       // determine whether to take the context passed in the CLI or not
       Object determineValue = process.env.PROD ? cliContext.SOMEKEY : 'my-prod-value';
       App.Builder.create()
               .postCliContext(Map.of(
                       "SOMEKEY", determineValue))
               .build();
       
    • getStackTraces

      @Stability(Stable) @Nullable default Boolean getStackTraces()
      Include construct creation stack trace in the aws:cdk:trace metadata key of all constructs.

      Default: true stack traces are included unless `aws:cdk:disable-stack-trace` is set in the context.

    • getTreeMetadata

      @Stability(Stable) @Nullable default Boolean getTreeMetadata()
      Include construct tree metadata as part of the Cloud Assembly.

      Default: true

    • builder

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