Class CfnOutput

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnOutput
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:01.499Z") @Stability(Stable) public class CfnOutput extends CfnElement
Example:

 Cluster cluster;
 // add service account
 ServiceAccount serviceAccount = cluster.addServiceAccount("MyServiceAccount");
 Bucket bucket = new Bucket(this, "Bucket");
 bucket.grantReadWrite(serviceAccount);
 KubernetesManifest mypod = cluster.addManifest("mypod", Map.of(
         "apiVersion", "v1",
         "kind", "Pod",
         "metadata", Map.of("name", "mypod"),
         "spec", Map.of(
                 "serviceAccountName", serviceAccount.getServiceAccountName(),
                 "containers", List.of(Map.of(
                         "name", "hello",
                         "image", "paulbouwer/hello-kubernetes:1.5",
                         "ports", List.of(Map.of("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
 CfnOutput.Builder.create(this, "ServiceAccountIamRole").value(serviceAccount.getRole().getRoleArn()).build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for CfnOutput.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.constructs.IConstruct

    software.constructs.IConstruct.Jsii$Default
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    CfnOutput(software.amazon.jsii.JsiiObjectRef objRef)
     
     
    CfnOutput(software.constructs.Construct scope, String id, CfnOutputProps props)
    Creates an CfnOutput value for this stack.
  • Method Summary

    Modifier and Type
    Method
    Description
    A condition to associate with this output value.
    A String type that describes the output value.
    The name used to export the value of this output across stacks.
    Return the Fn.importValue expression to import this value into another stack.
    The value of the property returned by the aws cloudformation describe-stacks command.
    void
    A condition to associate with this output value.
    void
    A String type that describes the output value.
    void
    The name used to export the value of this output across stacks.
    void
    The value of the property returned by the aws cloudformation describe-stacks command.

    Methods inherited from class software.amazon.awscdk.CfnElement

    getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId

    Methods inherited from class software.constructs.Construct

    getNode, isConstruct, toString

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • CfnOutput

      protected CfnOutput(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnOutput

      protected CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnOutput

      @Stability(Stable) public CfnOutput(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnOutputProps props)
      Creates an CfnOutput value for this stack.

      Parameters:
      scope - The parent construct. This parameter is required.
      id - This parameter is required.
      props - CfnOutput properties. This parameter is required.
  • Method Details

    • getImportValue

      @Stability(Stable) @NotNull public String getImportValue()
      Return the Fn.importValue expression to import this value into another stack.

      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.

    • getValue

      @Stability(Stable) @NotNull public Object getValue()
      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.

    • setValue

      @Stability(Stable) public void setValue(@NotNull Object 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.

    • getCondition

      @Stability(Stable) @Nullable public CfnCondition getCondition()
      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.

    • setCondition

      @Stability(Stable) public void setCondition(@Nullable CfnCondition value)
      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.

    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A String type that describes the output value.

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

      Default: - No description.

    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A String type that describes the output value.

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

      Default: - No description.

    • getExportName

      @Stability(Stable) @Nullable public String getExportName()
      The name used to export the value of this output across stacks.

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

      Default: - the output is not exported

    • setExportName

      @Stability(Stable) public void setExportName(@Nullable String value)
      The name used to export the value of this output across stacks.

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

      Default: - the output is not exported