Class PDKNagApp.Builder
- java.lang.Object
-
- software.aws.awsprototypingsdk.pdknag.PDKNagApp.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PDKNagApp.BuilderanalyticsReporting(Boolean analyticsReporting)Include runtime versioning information in the Stacks of this app.PDKNagApp.BuilderautoSynth(Boolean autoSynth)Automatically call `synth()` before the program exits.PDKNagAppbuild()PDKNagApp.Buildercontext(Map<String,? extends Object> context)Additional context values for the application.static PDKNagApp.Buildercreate()PDKNagApp.BuilderfailOnError(Boolean failOnError)Determines whether any errors encountered should trigger a test failure.PDKNagApp.BuilderfailOnWarning(Boolean failOnWarning)Determines whether any warnings encountered should trigger a test failure.PDKNagApp.BuildernagPacks(List<? extends io.github.cdklabs.cdknag.NagPack> nagPacks)Custom nag packs to execute.PDKNagApp.Builderoutdir(String outdir)The output directory into which to emit synthesized artifacts.PDKNagApp.BuilderpostCliContext(Map<String,? extends Object> postCliContext)Additional context values for the application.PDKNagApp.BuilderstackTraces(Boolean stackTraces)Include construct creation stack trace in the `aws:cdk:trace` metadata key of all constructs.PDKNagApp.BuildertreeMetadata(Boolean treeMetadata)Include construct tree metadata as part of the Cloud Assembly.
-
-
-
Method Detail
-
create
@Stability(Stable) public static PDKNagApp.Builder create()
- Returns:
- a new instance of
PDKNagApp.Builder.
-
analyticsReporting
@Stability(Stable) public PDKNagApp.Builder analyticsReporting(Boolean analyticsReporting)
Include runtime versioning information in the Stacks of this app.Default: Value of 'aws:cdk:version-reporting' context key
- Parameters:
analyticsReporting- Include runtime versioning information in the Stacks of this app. This parameter is required.- Returns:
this
-
autoSynth
@Stability(Stable) public PDKNagApp.Builder autoSynth(Boolean autoSynth)
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 callingsynth()is still recommended.Default: true if running via CDK CLI (`CDK_OUTDIR` is set), `false` otherwise
- Parameters:
autoSynth- Automatically call `synth()` before the program exits. This parameter is required.- Returns:
this
-
context
@Stability(Stable) public PDKNagApp.Builder context(Map<String,? extends Object> context)
Additional context values for the application.Context set by the CLI or the
contextkey incdk.jsonhas precedence.Context can be read from any construct using
node.getContext(key).Default: - no additional context
- Parameters:
context- Additional context values for the application. This parameter is required.- Returns:
this
-
outdir
@Stability(Stable) public PDKNagApp.Builder outdir(String outdir)
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
--outputflag 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.
- Parameters:
outdir- The output directory into which to emit synthesized artifacts. This parameter is required.- Returns:
this
-
postCliContext
@Stability(Stable) public PDKNagApp.Builder postCliContext(Map<String,? extends Object> postCliContext)
Additional context values for the application.Context provided here has precedence over context set by:
- The CLI via --context
- The
contextkey incdk.json - The {@link AppProps.context} property
This property is recommended over the {@link 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 const cliContext = JSON.parse(process.env.CDK_CONTEXT!); // determine whether to take the context passed in the CLI or not const determineValue = process.env.PROD ? cliContext.SOMEKEY : 'my-prod-value'; new App({ postCliContext: { SOMEKEY: determineValue, }, });- Parameters:
postCliContext- Additional context values for the application. This parameter is required.- Returns:
this
-
stackTraces
@Stability(Stable) public PDKNagApp.Builder stackTraces(Boolean stackTraces)
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.
- Parameters:
stackTraces- Include construct creation stack trace in the `aws:cdk:trace` metadata key of all constructs. This parameter is required.- Returns:
this
-
treeMetadata
@Stability(Stable) public PDKNagApp.Builder treeMetadata(Boolean treeMetadata)
Include construct tree metadata as part of the Cloud Assembly.Default: true
- Parameters:
treeMetadata- Include construct tree metadata as part of the Cloud Assembly. This parameter is required.- Returns:
this
-
failOnError
@Stability(Stable) public PDKNagApp.Builder failOnError(Boolean failOnError)
Determines whether any errors encountered should trigger a test failure.Default: false
- Parameters:
failOnError- Determines whether any errors encountered should trigger a test failure. This parameter is required.- Returns:
this
-
failOnWarning
@Stability(Stable) public PDKNagApp.Builder failOnWarning(Boolean failOnWarning)
Determines whether any warnings encountered should trigger a test failure.Default: false
- Parameters:
failOnWarning- Determines whether any warnings encountered should trigger a test failure. This parameter is required.- Returns:
this
-
nagPacks
@Stability(Stable) public PDKNagApp.Builder nagPacks(List<? extends io.github.cdklabs.cdknag.NagPack> nagPacks)
Custom nag packs to execute.Default: DEFAULT_NAG_PACKS
- Parameters:
nagPacks- Custom nag packs to execute. This parameter is required.- Returns:
this
-
-