Show / Hide Table of Contents

Class CfnOutput

Inheritance
System.Object
CfnElement
CfnOutput
Inherited Members
CfnElement.IsCfnElement(Object)
CfnElement.OverrideLogicalId(String)
CfnElement.CreationStack
CfnElement.LogicalId
CfnElement.Stack
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnOutput : CfnElement
Syntax (vb)
Public Class CfnOutput
    Inherits CfnElement
Remarks

ExampleMetadata: infused

Examples
Cluster cluster;

// add service account
var serviceAccount = cluster.AddServiceAccount("MyServiceAccount");

var bucket = new Bucket(this, "Bucket");
bucket.GrantReadWrite(serviceAccount);

var mypod = cluster.AddManifest("mypod", new Dictionary<string, object> {
    { "apiVersion", "v1" },
    { "kind", "Pod" },
    { "metadata", new Dictionary<string, string> { { "name", "mypod" } } },
    { "spec", new Dictionary<string, object> {
        { "serviceAccountName", serviceAccount.ServiceAccountName },
        { "containers", new [] { new Struct {
            Name = "hello",
            Image = "paulbouwer/hello-kubernetes:1.5",
            Ports = new [] { new Struct { ContainerPort = 8080 } }
        } } }
    } }
});

// create the resource after the service account.
mypod.Node.AddDependency(serviceAccount);

// print the IAM role arn for this service account
// print the IAM role arn for this service account
new CfnOutput(this, "ServiceAccountIamRole", new CfnOutputProps { Value = serviceAccount.Role.RoleArn });

Synopsis

Constructors

CfnOutput(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

CfnOutput(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

CfnOutput(Construct, String, ICfnOutputProps)

Creates an CfnOutput value for this stack.

Properties

Condition

A condition to associate with this output value.

Description

A String type that describes the output value.

ExportName

The name used to export the value of this output across stacks.

ImportValue

Return the Fn.importValue expression to import this value into another stack.

Value

The value of the property returned by the aws cloudformation describe-stacks command.

Constructors

CfnOutput(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected CfnOutput(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

CfnOutput(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected CfnOutput(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

CfnOutput(Construct, String, ICfnOutputProps)

Creates an CfnOutput value for this stack.

public CfnOutput(Construct scope, string id, ICfnOutputProps props)
Parameters
scope Constructs.Construct

The parent construct.

id System.String

The parent construct.

props ICfnOutputProps

CfnOutput properties.

Properties

Condition

A condition to associate with this output value.

public virtual CfnCondition Condition { get; set; }
Property Value

CfnCondition

Remarks

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.

public virtual string Description { get; set; }
Property Value

System.String

Remarks

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

Default: - No description.

ExportName

The name used to export the value of this output across stacks.

public virtual string ExportName { get; set; }
Property Value

System.String

Remarks

To use the value in another stack, pass the value of output.importValue to it.

Default: - the output is not exported

ImportValue

Return the Fn.importValue expression to import this value into another stack.

public virtual string ImportValue { get; }
Property Value

System.String

Remarks

The returned value should not be used in the same stack, but in a different one. It must be deployed to the same environment, as CloudFormation exports can only be imported in the same Region and account.

The is no automatic registration of dependencies between stacks when using this mechanism, so you should make sure to deploy them in the right order yourself.

You can use this mechanism to share values across Stacks in different Stages. If you intend to share the value to another Stack inside the same Stage, the automatic cross-stack referencing mechanism is more convenient.

Value

The value of the property returned by the aws cloudformation describe-stacks command.

public virtual object Value { get; set; }
Property Value

System.Object

Remarks

The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.

Back to top Generated by DocFX