Class CfnInclude.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnInclude>
- Enclosing class:
CfnInclude
CfnInclude
.-
Method Summary
Modifier and TypeMethodDescriptionallowCyclicalReferences
(Boolean allowCyclicalReferences) Specifies whether to allow cyclical references, effectively disregarding safeguards meant to avoid undeployable templates.build()
static CfnInclude.Builder
dehydratedResources
(List<String> dehydratedResources) 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.loadNestedStacks
(Map<String, ? extends CfnIncludeProps> loadNestedStacks) Specifies the template files that define nested stacks that should be included.parameters
(Map<String, ? extends Object> parameters) Specifies parameters to be replaced by the values in this mapping.preserveLogicalIds
(Boolean preserveLogicalIds) Whether the resources should have the same logical IDs in the resulting CDK template as they did in the original CloudFormation template file.templateFile
(String templateFile) Path to the template file.
-
Method Details
-
create
@Stability(Stable) public static CfnInclude.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
CfnInclude.Builder
.
-
templateFile
Path to the template file.Both JSON and YAML template formats are supported.
- Parameters:
templateFile
- Path to the template file. This parameter is required.- Returns:
this
-
allowCyclicalReferences
@Stability(Stable) public CfnInclude.Builder allowCyclicalReferences(Boolean allowCyclicalReferences) 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.
Default: - will throw an error on detecting any cyclical references
- Parameters:
allowCyclicalReferences
- Specifies whether to allow cyclical references, effectively disregarding safeguards meant to avoid undeployable templates. This parameter is required.- Returns:
this
-
dehydratedResources
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.Default: - All resources are hydrated
- Parameters:
dehydratedResources
- 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 parameter is required.- Returns:
this
-
loadNestedStacks
@Stability(Stable) public CfnInclude.Builder loadNestedStacks(Map<String, ? extends CfnIncludeProps> loadNestedStacks) 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 theCfnInclude.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.
Default: - no nested stacks will be included
- Parameters:
loadNestedStacks
- Specifies the template files that define nested stacks that should be included. This parameter is required.- Returns:
this
-
parameters
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.
Default: - parameters will retain their original definitions
- Parameters:
parameters
- Specifies parameters to be replaced by the values in this mapping. This parameter is required.- Returns:
this
-
preserveLogicalIds
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.Default: true
- Parameters:
preserveLogicalIds
- Whether the resources should have the same logical IDs in the resulting CDK template as they did in the original CloudFormation template file. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnInclude>
- Returns:
- a newly built instance of
CfnInclude
.
-