Show / Hide Table of Contents

Interface IAppProps

Initialization props for apps.

Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAppProps
Syntax (vb)
Public Interface IAppProps
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.S3;


            var app = new App(new AppProps {
                DefaultStackSynthesizer = AppStagingSynthesizer.DefaultResources(new DefaultResourcesOptions {
                    AppId = "my-app-id",
                    StagingBucketEncryption = BucketEncryption.S3_MANAGED,
                    DeploymentIdentities = DeploymentIdentities.SpecifyRoles(new BootstrapRoles {
                        CloudFormationExecutionRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Execute"),
                        DeploymentRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Deploy"),
                        LookupRole = BootstrapRole.FromRoleArn("arn:aws:iam::123456789012:role/Lookup")
                    })
                })
            });

Synopsis

Properties

AnalyticsReporting

Include runtime versioning information in the Stacks of this app.

AutoSynth

Automatically call synth() before the program exits.

Context

Additional context values for the application.

DefaultStackSynthesizer

The stack synthesizer to use by default for all Stacks in the App.

Outdir

The output directory into which to emit synthesized artifacts.

PolicyValidationBeta1

Validation plugins to run after synthesis.

PostCliContext

Additional context values for the application.

PropertyInjectors

A list of IPropertyInjector attached to this App.

StackTraces

Include construct creation stack trace in the aws:cdk:trace metadata key of all constructs.

TreeMetadata

Include construct tree metadata as part of the Cloud Assembly.

Properties

AnalyticsReporting

Include runtime versioning information in the Stacks of this app.

bool? AnalyticsReporting { get; }
Property Value

bool?

Remarks

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

AutoSynth

Automatically call synth() before the program exits.

bool? AutoSynth { get; }
Property Value

bool?

Remarks

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

Context

Additional context values for the application.

IDictionary<string, object>? Context { get; }
Property Value

IDictionary<string, object>

Remarks

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

DefaultStackSynthesizer

The stack synthesizer to use by default for all Stacks in the App.

IReusableStackSynthesizer? DefaultStackSynthesizer { get; }
Property Value

IReusableStackSynthesizer

Remarks

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

Outdir

The output directory into which to emit synthesized artifacts.

string? Outdir { get; }
Property Value

string

Remarks

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.

PolicyValidationBeta1

Validation plugins to run after synthesis.

IPolicyValidationPluginBeta1[]? PolicyValidationBeta1 { get; }
Property Value

IPolicyValidationPluginBeta1[]

Remarks

Default: - no validation plugins

PostCliContext

Additional context values for the application.

IDictionary<string, object>? PostCliContext { get; }
Property Value

IDictionary<string, object>

Remarks

Context provided here has precedence over context set by:

    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

    Examples
    // context from the CLI and from `cdk.json` are stored in the
                 // CDK_CONTEXT env variable
                 var cliContext = JSON.Parse(process.Env.CDK_CONTEXT);
    
                 // determine whether to take the context passed in the CLI or not
                 var determineValue = process.env.PROD ? cliContext.SOMEKEY : 'my-prod-value';
                 new App(new AppProps {
                     PostCliContext = new Dictionary<string, object> {
                         { "SOMEKEY", determineValue }
                     }
                 });

    PropertyInjectors

    A list of IPropertyInjector attached to this App.

    IPropertyInjector[]? PropertyInjectors { get; }
    Property Value

    IPropertyInjector[]

    Remarks

    Default: - no PropertyInjectors

    StackTraces

    Include construct creation stack trace in the aws:cdk:trace metadata key of all constructs.

    bool? StackTraces { get; }
    Property Value

    bool?

    Remarks

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

    TreeMetadata

    Include construct tree metadata as part of the Cloud Assembly.

    bool? TreeMetadata { get; }
    Property Value

    bool?

    Remarks

    Default: true

    Back to top Generated by DocFX