interface CfnIncludeProps
Language | Type name |
---|---|
.NET | Amazon.CDK.CloudFormation.Include.CfnIncludeProps |
Java | software.amazon.awscdk.cloudformation.include.CfnIncludeProps |
Python | aws_cdk.cloudformation_include.CfnIncludeProps |
TypeScript (source) | @aws-cdk/cloudformation-include » CfnIncludeProps |
Construction properties of {@link CfnInclude}.
Example
const parentTemplate = new cfn_inc.CfnInclude(this, 'ParentStack', {
templateFile: 'path/to/my-parent-template.json',
loadNestedStacks: {
'ChildStack': {
templateFile: 'path/to/my-nested-template.json',
},
},
});
Properties
Name | Type | Description |
---|---|---|
template | string | Path to the template file. |
load | { [string]: Cfn } | Specifies the template files that define nested stacks that should be included. |
parameters? | { [string]: any } | Specifies parameters to be replaced by the values in this mapping. |
preserve | boolean | Whether the resources should have the same logical IDs in the resulting CDK template as they did in the original CloudFormation template file. |
templateFile
Type:
string
Path to the template file.
Both JSON and YAML template formats are supported.
loadNestedStacks?
Type:
{ [string]:
Cfn
}
(optional, 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 {@link CfnInclude.getNestedStack} method (but will still be accessible from the {@link 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.
parameters?
Type:
{ [string]: any }
(optional, default: no parameters will be replaced)
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.
preserveLogicalIds?
Type:
boolean
(optional, 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 {@link CfnInclude.getResource} and related methods always uses the original logical ID of the resource/element, as specified in the template file.