CfnOutput

class aws_cdk.core.CfnOutput(scope, id, *, value, condition=None, description=None, export_name=None)

Bases: aws_cdk.core.CfnElement

__init__(scope, id, *, value, condition=None, description=None, export_name=None)

Creates an CfnOutput value for this stack.

Parameters
  • scope (Construct) – The parent construct.

  • id (str) –

  • props – CfnOutput properties.

  • value (str) – The value of the property returned by the aws cloudformation describe-stacks command. The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.

  • condition (Optional[CfnCondition]) – A condition to associate with this output value. If the condition evaluates to false, this output value will not be included in the stack. Default: - No condition is associated with the output.

  • description (Optional[str]) – A String type that describes the output value. The description can be a maximum of 4 K in length. Default: - No description.

  • export_name (Optional[str]) – The name used to export the value of this output across stacks. To import the value from another stack, use Fn.importValue(exportName). Default: - the output is not exported

Return type

None

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 :rtype: List[str] :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).

return :rtype: str :return:

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

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

stack

The stack in which this element is defined.

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

Return type

Stack

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 :rtype: bool :return: 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