CfnInclude

class aws_cdk.core.CfnInclude(scope, id, *, template)

Bases: CfnElement

(deprecated) 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.

Deprecated:

use the CfnInclude class from the cloudformation-include module instead

Stability:

deprecated

ExampleMetadata:

infused

Example:

CfnInclude(self, "ID",
    template={
        "Resources": {
            "Bucket": {
                "Type": "AWS::S3::Bucket",
                "Properties": {
                    "BucketName": "my-shiny-bucket"
                }
            }
        }
    }
)

(deprecated) 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.

Parameters:
  • scope (Construct) – The parent construct of this template.

  • id (str) – The ID of this construct.

  • template (Mapping[Any, Any]) – (deprecated) The CloudFormation template to include in the stack (as is).

Stability:

deprecated

Methods

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

logical_id

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).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

template

(deprecated) The included template.

Stability:

deprecated

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool