Class CfnInclude
- All Implemented Interfaces:
- software.amazon.jsii.JsiiSerializable,- software.constructs.IConstruct,- software.constructs.IDependable
 All resources defined in the template file can be retrieved by calling the getResource method.
 Any modifications made on the returned resource objects will be reflected in the resulting CDK template.
 
Example:
 CfnInclude cfnTemplate = CfnInclude.Builder.create(this, "Template")
         .templateFile("my-template.json")
         .build();
 - 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$Default
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCfnInclude(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnInclude(software.amazon.jsii.JsiiObjectRef objRef) CfnInclude(software.constructs.Construct scope, String id, CfnIncludeProps props) 
- 
Method SummaryModifier and TypeMethodDescriptiongetCondition(String conditionName) Returns the CfnCondition object from the 'Conditions' section of the CloudFormation template with the given name.Returns the CfnHook object from the 'Hooks' section of the included CloudFormation template with the given logical ID.getMapping(String mappingName) Returns the CfnMapping object from the 'Mappings' section of the included template.getNestedStack(String logicalId) Returns a loaded NestedStack with name logicalId.Returns the CfnOutput object from the 'Outputs' section of the included template.getParameter(String parameterName) Returns the CfnParameter object from the 'Parameters' section of the included template.getResource(String logicalId) Returns the low-level CfnResource from the template with the given logical ID.Returns the CfnRule object from the 'Rules' section of the CloudFormation template with the given name.loadNestedStack(String logicalId, CfnIncludeProps nestedStackProps) Includes a template for a child stack inside of this parent template.Methods inherited from class software.amazon.awscdk.CfnElementgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.ConstructgetNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
CfnIncludeprotected CfnInclude(software.amazon.jsii.JsiiObjectRef objRef) 
- 
CfnIncludeprotected CfnInclude(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
CfnInclude@Stability(Stable) public CfnInclude(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnIncludeProps props) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- props- This parameter is required.
 
 
- 
- 
Method Details- 
getConditionReturns the CfnCondition object from the 'Conditions' section of the CloudFormation template with the given name.Any modifications performed on that object will be reflected in the resulting CDK template. If a Condition with the given name is not present in the template, throws an exception. - Parameters:
- conditionName- the name of the Condition in the CloudFormation template file. This parameter is required.
 
- 
getHookReturns the CfnHook object from the 'Hooks' section of the included CloudFormation template with the given logical ID.Any modifications performed on the returned object will be reflected in the resulting CDK template. If a Hook with the given logical ID is not present in the template, an exception will be thrown. - Parameters:
- hookLogicalId- the logical ID of the Hook in the included CloudFormation template's 'Hooks' section. This parameter is required.
 
- 
getMappingReturns the CfnMapping object from the 'Mappings' section of the included template.Any modifications performed on that object will be reflected in the resulting CDK template. If a Mapping with the given name is not present in the template, an exception will be thrown. - Parameters:
- mappingName- the name of the Mapping in the template to retrieve. This parameter is required.
 
- 
getNestedStackReturns a loaded NestedStack with name logicalId.For a nested stack to be returned by this method, it must be specified either in the CfnIncludeProps.loadNestedStacksproperty, or through theloadNestedStackmethod.- Parameters:
- logicalId- the ID of the stack to retrieve, as it appears in the template. This parameter is required.
 
- 
getOutputReturns the CfnOutput object from the 'Outputs' section of the included template.Any modifications performed on that object will be reflected in the resulting CDK template. If an Output with the given name is not present in the template, throws an exception. - Parameters:
- logicalId- the name of the output to retrieve. This parameter is required.
 
- 
getParameterReturns the CfnParameter object from the 'Parameters' section of the included template.Any modifications performed on that object will be reflected in the resulting CDK template. If a Parameter with the given name is not present in the template, throws an exception. - Parameters:
- parameterName- the name of the parameter to retrieve. This parameter is required.
 
- 
getResourceReturns the low-level CfnResource from the template with the given logical ID.Any modifications performed on that resource will be reflected in the resulting CDK template. The returned object will be of the proper underlying class; you can always cast it to the correct type in your code: // assume the template contains an AWS::S3::Bucket with logical ID 'Bucket' const cfnBucket = cfnTemplate.getResource('Bucket') as s3.CfnBucket; // cfnBucket is of type s3.CfnBucketIf the template does not contain a resource with the given logical ID, an exception will be thrown. - Parameters:
- logicalId- the logical ID of the resource in the CloudFormation template file. This parameter is required.
 
- 
getRuleReturns the CfnRule object from the 'Rules' section of the CloudFormation template with the given name.Any modifications performed on that object will be reflected in the resulting CDK template. If a Rule with the given name is not present in the template, an exception will be thrown. - Parameters:
- ruleName- the name of the Rule in the CloudFormation template. This parameter is required.
 
- 
loadNestedStack@Stability(Stable) @NotNull public IncludedNestedStack loadNestedStack(@NotNull String logicalId, @NotNull CfnIncludeProps nestedStackProps) Includes a template for a child stack inside of this parent template.A child with this logical ID must exist in the template, and be of type AWS::CloudFormation::Stack. This is equivalent to specifying the value in the CfnIncludeProps.loadNestedStacksproperty on object construction.- Parameters:
- logicalId- the ID of the stack to retrieve, as it appears in the template. This parameter is required.
- nestedStackProps- the properties of the included child Stack. This parameter is required.
- Returns:
- the same IncludedNestedStackobject thatgetNestedStackreturns for this logical ID
 
 
-