Class: AWSCDK::CloudFormationInclude::CfnIncludeProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFormationInclude::CfnIncludeProps
- Defined in:
- cloud_formation_include/cfn_include_props.rb
Overview
Construction properties of CfnInclude.
Instance Attribute Summary collapse
-
#allow_cyclical_references ⇒ Boolean?
readonly
Specifies whether to allow cyclical references, effectively disregarding safeguards meant to avoid undeployable templates.
-
#dehydrated_resources ⇒ Array<String>?
readonly
Specifies a list of LogicalIDs for resources that will be included in the CDK Stack, but will not be parsed and converted to CDK types.
-
#load_nested_stacks ⇒ Hash{String => AWSCDK::CloudFormationInclude::CfnIncludeProps}?
readonly
Specifies the template files that define nested stacks that should be included.
-
#parameters ⇒ Hash{String => Object}?
readonly
Specifies parameters to be replaced by the values in this mapping.
-
#preserve_logical_ids ⇒ Boolean?
readonly
Whether the resources should have the same logical IDs in the resulting CDK template as they did in the original CloudFormation template file.
-
#template_file ⇒ String
readonly
Path to the template file.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(template_file:, allow_cyclical_references: nil, dehydrated_resources: nil, load_nested_stacks: nil, parameters: nil, preserve_logical_ids: nil) ⇒ CfnIncludeProps
constructor
A new instance of CfnIncludeProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(template_file:, allow_cyclical_references: nil, dehydrated_resources: nil, load_nested_stacks: nil, parameters: nil, preserve_logical_ids: nil) ⇒ CfnIncludeProps
Returns a new instance of CfnIncludeProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'cloud_formation_include/cfn_include_props.rb', line 13 def initialize(template_file:, allow_cyclical_references: nil, dehydrated_resources: nil, load_nested_stacks: nil, parameters: nil, preserve_logical_ids: nil) @template_file = template_file Jsii::Type.check_type(@template_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "templateFile") @allow_cyclical_references = allow_cyclical_references Jsii::Type.check_type(@allow_cyclical_references, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowCyclicalReferences") unless @allow_cyclical_references.nil? @dehydrated_resources = dehydrated_resources Jsii::Type.check_type(@dehydrated_resources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dehydratedResources") unless @dehydrated_resources.nil? @load_nested_stacks = load_nested_stacks.is_a?(Hash) ? load_nested_stacks.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudFormationInclude::CfnIncludeProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : load_nested_stacks Jsii::Type.check_type(@load_nested_stacks, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmNsb3VkZm9ybWF0aW9uX2luY2x1ZGUuQ2ZuSW5jbHVkZVByb3BzIn0sImtpbmQiOiJtYXAifX0=")), "loadNestedStacks") unless @load_nested_stacks.nil? @parameters = parameters Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "parameters") unless @parameters.nil? @preserve_logical_ids = preserve_logical_ids Jsii::Type.check_type(@preserve_logical_ids, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "preserveLogicalIds") unless @preserve_logical_ids.nil? end |
Instance Attribute Details
#allow_cyclical_references ⇒ Boolean? (readonly)
Default: - will throw an error on detecting any cyclical references
Specifies whether to allow cyclical references, effectively disregarding safeguards meant to avoid undeployable templates.
This should only be set to true in the case of templates utilizing cloud transforms (e.g. SAM) that after processing the transform will no longer contain any circular references.
41 42 43 |
# File 'cloud_formation_include/cfn_include_props.rb', line 41 def allow_cyclical_references @allow_cyclical_references end |
#dehydrated_resources ⇒ Array<String>? (readonly)
Default: - All resources are hydrated
Specifies a list of LogicalIDs for resources that will be included in the CDK Stack, but will not be parsed and converted to CDK types.
This allows you to use CFN templates
that rely on Intrinsic placement that cfn-include
would otherwise reject, such as non-primitive values in resource update policies.
50 51 52 |
# File 'cloud_formation_include/cfn_include_props.rb', line 50 def dehydrated_resources @dehydrated_resources end |
#load_nested_stacks ⇒ Hash{String => AWSCDK::CloudFormationInclude::CfnIncludeProps}? (readonly)
Default: - no nested stacks will be included
Specifies the template files that define nested stacks that should be included.
If your template specifies a stack that isn't included here, it won't be created as a NestedStack
resource, and it won't be accessible from the CfnInclude.getNestedStack method
(but will still be accessible from the CfnInclude.getResource method).
If you include a stack here with an ID that isn't in the template, or is in the template but is not a nested stack, template creation will fail and an error will be thrown.
63 64 65 |
# File 'cloud_formation_include/cfn_include_props.rb', line 63 def load_nested_stacks @load_nested_stacks end |
#parameters ⇒ Hash{String => Object}? (readonly)
Default: - parameters will retain their original definitions
Specifies parameters to be replaced by the values in this mapping.
Any parameters in the template that aren't specified here will be left unmodified. If you include a parameter here with an ID that isn't in the template, template creation will fail and an error will be thrown.
If you are importing a parameter from a live stack, we cannot know the value of that parameter. You will need to supply a value for your parameters, else the default value will be used.
76 77 78 |
# File 'cloud_formation_include/cfn_include_props.rb', line 76 def parameters @parameters end |
#preserve_logical_ids ⇒ Boolean? (readonly)
Default: true
Whether the resources should have the same logical IDs in the resulting CDK template as they did in the original CloudFormation template file.
If you're vending a Construct using an existing CloudFormation template,
make sure to pass this as false.
Note: regardless of whether this option is true or false,
the CfnInclude.getResource and related methods always uses the original logical ID of the resource/element,
as specified in the template file.
88 89 90 |
# File 'cloud_formation_include/cfn_include_props.rb', line 88 def preserve_logical_ids @preserve_logical_ids end |
#template_file ⇒ String (readonly)
Path to the template file.
Both JSON and YAML template formats are supported.
33 34 35 |
# File 'cloud_formation_include/cfn_include_props.rb', line 33 def template_file @template_file end |
Class Method Details
.jsii_properties ⇒ Object
90 91 92 93 94 95 96 97 98 99 |
# File 'cloud_formation_include/cfn_include_props.rb', line 90 def self.jsii_properties { :template_file => "templateFile", :allow_cyclical_references => "allowCyclicalReferences", :dehydrated_resources => "dehydratedResources", :load_nested_stacks => "loadNestedStacks", :parameters => "parameters", :preserve_logical_ids => "preserveLogicalIds", } end |
Instance Method Details
#to_jsii ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'cloud_formation_include/cfn_include_props.rb', line 101 def to_jsii result = {} result.merge!({ "templateFile" => @template_file, "allowCyclicalReferences" => @allow_cyclical_references, "dehydratedResources" => @dehydrated_resources, "loadNestedStacks" => @load_nested_stacks, "parameters" => @parameters, "preserveLogicalIds" => @preserve_logical_ids, }) result.compact end |