class CfnInclude (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.CfnInclude |
Java | software.amazon.awscdk.core.CfnInclude |
Python | aws_cdk.core.CfnInclude |
TypeScript (source) | @aws-cdk/core » CfnInclude |
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Implements
IConstruct
, IConstruct
, IDependable
Includes a CloudFormation template into a stack.
All elements of the template will be merged into the current stack, together with any elements created programmatically.
Example
new CfnInclude(this, 'ID', {
template: {
Resources: {
Bucket: {
Type: 'AWS::S3::Bucket',
Properties: {
BucketName: 'my-shiny-bucket'
}
}
}
},
});
Initializer
new CfnInclude(scope: Construct, id: string, props: CfnIncludeProps)
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Parameters
- scope
Construct
— The parent construct of this template. - id
string
— The ID of this construct. - props
Cfn
— Initialization properties.Include Props
Creates an adopted template construct.
The template will be incorporated into the stack as-is with no changes at all. This means that logical IDs of entities within this template may conflict with logical IDs of entities that are part of the stack.
Construct Props
Name | Type | Description |
---|---|---|
template | json | The CloudFormation template to include in the stack (as is). |
template
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
json
The CloudFormation template to include in the stack (as is).
Properties
Name | Type | Description |
---|---|---|
creation | string[] | |
logical | string | The logical ID for this CloudFormation stack element. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this element is defined. |
template | json | The included template. |
creationStack
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
string[]
logicalId
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
string
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
node
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
Construct
The construct tree node associated with this construct.
stack
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
template
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Type:
json
The included template.
Methods
Name | Description |
---|---|
override | Overrides the auto-generated logical ID with a specific ID. |
to | Returns a string representation of this construct. |
LogicalId(newLogicalId)
overridepublic overrideLogicalId(newLogicalId: string): void
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
String()
topublic toString(): string
⚠️ Deprecated: use the CfnInclude class from the cloudformation-include module instead
Returns
string
Returns a string representation of this construct.