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.CliCredentials()
})
});
Synopsis
Properties
AnalyticsReporting | Include runtime versioning information in the Stacks of this app. |
AutoSynth | Automatically call |
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. |
StackTraces | Include construct creation stack trace in the |
TreeMetadata | Include construct tree metadata as part of the Cloud Assembly. |
Properties
AnalyticsReporting
Include runtime versioning information in the Stacks of this app.
virtual Nullable<bool> AnalyticsReporting { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: Value of 'aws:cdk:version-reporting' context key
AutoSynth
Automatically call synth()
before the program exits.
virtual Nullable<bool> AutoSynth { get; }
Property Value
System.Nullable<System.Boolean>
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.
virtual IDictionary<string, object> Context { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.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.
virtual IReusableStackSynthesizer DefaultStackSynthesizer { get; }
Property Value
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.
virtual string Outdir { get; }
Property Value
System.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.
virtual IPolicyValidationPluginBeta1[] PolicyValidationBeta1 { get; }
Property Value
IPolicyValidationPluginBeta1[]
Remarks
Default: - no validation plugins
PostCliContext
Additional context values for the application.
virtual IDictionary<string, object> PostCliContext { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.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 }
}
});
StackTraces
Include construct creation stack trace in the aws:cdk:trace
metadata key of all constructs.
virtual Nullable<bool> StackTraces { get; }
Property Value
System.Nullable<System.Boolean>
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.
virtual Nullable<bool> TreeMetadata { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true