Class: AWSCDK::AppProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_props.rb

Overview

Initialization props for apps.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(analytics_reporting: nil, auto_synth: nil, context: nil, default_stack_synthesizer: nil, outdir: nil, performance_reporting: nil, policy_validation_beta1: nil, post_cli_context: nil, property_injectors: nil, stack_traces: nil, tree_metadata: nil) ⇒ AppProps

Returns a new instance of AppProps.

Parameters:

  • analytics_reporting (Boolean, nil) (defaults to: nil)

    Include runtime versioning information in the Stacks of this app.

  • auto_synth (Boolean, nil) (defaults to: nil)

    Automatically call synth() before the program exits.

  • context (Hash{String => Object}, nil) (defaults to: nil)

    Additional context values for the application.

  • default_stack_synthesizer (AWSCDK::IReusableStackSynthesizer, nil) (defaults to: nil)

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

  • outdir (String, nil) (defaults to: nil)

    The output directory into which to emit synthesized artifacts.

  • performance_reporting (Boolean, nil) (defaults to: nil)

    Produce a performance counter report if supported by the CLI.

  • policy_validation_beta1 (Array<AWSCDK::IPolicyValidationPluginBeta1>, nil) (defaults to: nil)

    Validation plugins to run after synthesis.

  • post_cli_context (Hash{String => Object}, nil) (defaults to: nil)

    Additional context values for the application.

  • property_injectors (Array<AWSCDK::IPropertyInjector>, nil) (defaults to: nil)

    A list of IPropertyInjector attached to this App.

  • stack_traces (Boolean, nil) (defaults to: nil)

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

  • tree_metadata (Boolean, nil) (defaults to: nil)

    Include construct tree metadata as part of the Cloud Assembly.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app_props.rb', line 18

def initialize(analytics_reporting: nil, auto_synth: nil, context: nil, default_stack_synthesizer: nil, outdir: nil, performance_reporting: nil, policy_validation_beta1: nil, post_cli_context: nil, property_injectors: nil, stack_traces: nil, tree_metadata: nil)
  @analytics_reporting = analytics_reporting
  Jsii::Type.check_type(@analytics_reporting, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "analyticsReporting") unless @analytics_reporting.nil?
  @auto_synth = auto_synth
  Jsii::Type.check_type(@auto_synth, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "autoSynth") unless @auto_synth.nil?
  @context = context
  Jsii::Type.check_type(@context, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "context") unless @context.nil?
  @default_stack_synthesizer = default_stack_synthesizer
  Jsii::Type.check_type(@default_stack_synthesizer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUmV1c2FibGVTdGFja1N5bnRoZXNpemVyIn0=")), "defaultStackSynthesizer") unless @default_stack_synthesizer.nil?
  @outdir = outdir
  Jsii::Type.check_type(@outdir, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outdir") unless @outdir.nil?
  @performance_reporting = performance_reporting
  Jsii::Type.check_type(@performance_reporting, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "performanceReporting") unless @performance_reporting.nil?
  @policy_validation_beta1 = policy_validation_beta1
  Jsii::Type.check_type(@policy_validation_beta1, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLklQb2xpY3lWYWxpZGF0aW9uUGx1Z2luQmV0YTEifSwia2luZCI6ImFycmF5In19")), "policyValidationBeta1") unless @policy_validation_beta1.nil?
  @post_cli_context = post_cli_context
  Jsii::Type.check_type(@post_cli_context, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "postCliContext") unless @post_cli_context.nil?
  @property_injectors = property_injectors
  Jsii::Type.check_type(@property_injectors, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLklQcm9wZXJ0eUluamVjdG9yIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "propertyInjectors") unless @property_injectors.nil?
  @stack_traces = stack_traces
  Jsii::Type.check_type(@stack_traces, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "stackTraces") unless @stack_traces.nil?
  @tree_metadata = 
  Jsii::Type.check_type(@tree_metadata, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "treeMetadata") unless @tree_metadata.nil?
end

Instance Attribute Details

#analytics_reportingBoolean? (readonly)

Note:

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

Include runtime versioning information in the Stacks of this app.

Returns:

  • (Boolean, nil)


47
48
49
# File 'app_props.rb', line 47

def analytics_reporting
  @analytics_reporting
end

#auto_synthBoolean? (readonly)

Note:

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

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.

Returns:

  • (Boolean, nil)


56
57
58
# File 'app_props.rb', line 56

def auto_synth
  @auto_synth
end

#contextHash{String => Object}? (readonly)

Note:

Default: - no additional context

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).

Returns:

  • (Hash{String => Object}, nil)


65
66
67
# File 'app_props.rb', line 65

def context
  @context
end

#default_stack_synthesizerAWSCDK::IReusableStackSynthesizer? (readonly)

Note:

Default: - A DefaultStackSynthesizer with default settings

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.



74
75
76
# File 'app_props.rb', line 74

def default_stack_synthesizer
  @default_stack_synthesizer
end

#outdirString? (readonly)

Note:

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

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.

Returns:

  • (String, nil)


85
86
87
# File 'app_props.rb', line 85

def outdir
  @outdir
end

#performance_reportingBoolean? (readonly)

Note:

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

Produce a performance counter report if supported by the CLI.

The performance report will be produced if the total synthesis time exceeds 10 seconds/stack, unless this property is used to switch the report off altogether (set to false).

Returns:

  • (Boolean, nil)


94
95
96
# File 'app_props.rb', line 94

def performance_reporting
  @performance_reporting
end

#policy_validation_beta1Array<AWSCDK::IPolicyValidationPluginBeta1>? (readonly)

Deprecated.

Use Validations.of(app).addPlugins() instead.

Note:

Default: - no validation plugins

Validation plugins to run after synthesis.

Returns:



100
101
102
# File 'app_props.rb', line 100

def policy_validation_beta1
  @policy_validation_beta1
end

#post_cli_contextHash{String => Object}? (readonly)

Note:

Default: - no additional context

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).

Examples:

# context from the CLI and from `cdk.json` are stored in the
# CDK_CONTEXT env variable
cli_context = JSON[:parse](Process::Env::CDK_CONTEXT)

# determine whether to take the context passed in the CLI or not
determine_value = Process::Env::PROD ? CliContext::SOMEKEY : "my-prod-value"
AWSCDK::App.new({
    post_cli_context: {
        SOMEKEY: determine_value,
    },
})

Returns:

  • (Hash{String => Object}, nil)


128
129
130
# File 'app_props.rb', line 128

def post_cli_context
  @post_cli_context
end

#property_injectorsArray<AWSCDK::IPropertyInjector>? (readonly)

Note:

Default: - no PropertyInjectors

A list of IPropertyInjector attached to this App.

Returns:



133
134
135
# File 'app_props.rb', line 133

def property_injectors
  @property_injectors
end

#stack_tracesBoolean? (readonly)

Note:

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

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

Returns:

  • (Boolean, nil)


138
139
140
# File 'app_props.rb', line 138

def stack_traces
  @stack_traces
end

#tree_metadataBoolean? (readonly)

Note:

Default: true

Include construct tree metadata as part of the Cloud Assembly.

Returns:

  • (Boolean, nil)


143
144
145
# File 'app_props.rb', line 143

def 
  @tree_metadata
end

Class Method Details

.jsii_propertiesObject



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'app_props.rb', line 145

def self.jsii_properties
  {
    :analytics_reporting => "analyticsReporting",
    :auto_synth => "autoSynth",
    :context => "context",
    :default_stack_synthesizer => "defaultStackSynthesizer",
    :outdir => "outdir",
    :performance_reporting => "performanceReporting",
    :policy_validation_beta1 => "policyValidationBeta1",
    :post_cli_context => "postCliContext",
    :property_injectors => "propertyInjectors",
    :stack_traces => "stackTraces",
    :tree_metadata => "treeMetadata",
  }
end

Instance Method Details

#to_jsiiObject



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'app_props.rb', line 161

def to_jsii
  result = {}
  result.merge!({
    "analyticsReporting" => @analytics_reporting,
    "autoSynth" => @auto_synth,
    "context" => @context,
    "defaultStackSynthesizer" => @default_stack_synthesizer,
    "outdir" => @outdir,
    "performanceReporting" => @performance_reporting,
    "policyValidationBeta1" => @policy_validation_beta1,
    "postCliContext" => @post_cli_context,
    "propertyInjectors" => @property_injectors,
    "stackTraces" => @stack_traces,
    "treeMetadata" => @tree_metadata,
  })
  result.compact
end