CfnOutputProps

class aws_cdk.core.CfnOutputProps(*, value, condition=None, description=None, export_name=None)

Bases: object

Parameters:
  • 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

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster

# add service account
service_account = cluster.add_service_account("MyServiceAccount")

bucket = s3.Bucket(self, "Bucket")
bucket.grant_read_write(service_account)

mypod = cluster.add_manifest("mypod", {
    "api_version": "v1",
    "kind": "Pod",
    "metadata": {"name": "mypod"},
    "spec": {
        "service_account_name": service_account.service_account_name,
        "containers": [{
            "name": "hello",
            "image": "paulbouwer/hello-kubernetes:1.5",
            "ports": [{"container_port": 8080}]
        }
        ]
    }
})

# create the resource after the service account.
mypod.node.add_dependency(service_account)

# print the IAM role arn for this service account
CfnOutput(self, "ServiceAccountIamRole", value=service_account.role.role_arn)

Attributes

condition

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

A String type that describes the output value.

The description can be a maximum of 4 K in length.

Default:
  • No description.

export_name

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

value

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.