Class CfnOutput
- All Implemented Interfaces:
IConstruct
,IDependable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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 TypeMethodDescriptionA 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 theFn.importValue
expression to import this value into another stack.getValue()
The value of the property returned by the aws cloudformation describe-stacks command.void
setCondition
(CfnCondition value) A condition to associate with this output value.void
setDescription
(String value) A String type that describes the output value.void
setExportName
(String value) 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.validate()
Validate the current construct.Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
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
-
validate
Validate the current construct.This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
-
getImportValue
Return theFn.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
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
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
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
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
A String type that describes the output value.The description can be a maximum of 4 K in length.
Default: - No description.
-
setDescription
A String type that describes the output value.The description can be a maximum of 4 K in length.
Default: - No description.
-
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
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
-