@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-05-19T23:08:43.997Z") @Stability(value=Stable) public class CfnOutput extends CfnElement
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnOutput.Builder
A fluent builder for
CfnOutput . |
software.amazon.jsii.JsiiObject.InitializationMode
IConstruct.Jsii$Default
Modifier | Constructor and Description |
---|---|
|
CfnOutput(software.constructs.Construct scope,
String id,
CfnOutputProps props)
Creates an CfnOutput value for this stack.
|
protected |
CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnOutput(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
CfnCondition |
getCondition()
A condition to associate with this output value.
|
String |
getDescription()
A String type that describes the output value.
|
String |
getExportName()
The name used to export the value of this output across stacks.
|
String |
getImportValue()
Return the `Fn.importValue` expression to import this value into another stack.
|
Object |
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 |
setValue(Object value)
The value of the property returned by the aws cloudformation describe-stacks command.
|
protected List<String> |
validate()
Validate the current construct.
|
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
protected CfnOutput(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public CfnOutput(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnOutputProps props)
scope
- The parent construct. This parameter is required.id
- This parameter is required.props
- CfnOutput properties. This parameter is required.@Stability(value=Stable) @NotNull protected List<String> validate()
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
@Stability(value=Stable) @NotNull public String getImportValue()
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.
@Stability(value=Stable) @NotNull public Object getValue()
The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
@Stability(value=Stable) public void setValue(@NotNull Object value)
The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
@Stability(value=Stable) @Nullable public CfnCondition getCondition()
If the condition evaluates
to false
, this output value will not be included in the stack.
Default: - No condition is associated with the output.
@Stability(value=Stable) public void setCondition(@Nullable CfnCondition 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.
@Stability(value=Stable) @Nullable public String getDescription()
The description can be a maximum of 4 K in length.
Default: - No description.
@Stability(value=Stable) public void setDescription(@Nullable String value)
The description can be a maximum of 4 K in length.
Default: - No description.
@Stability(value=Stable) @Nullable public String getExportName()
To use the value in another stack, pass the value of
output.importValue
to it.
Default: - the output is not exported
@Stability(value=Stable) public void setExportName(@Nullable String value)
To use the value in another stack, pass the value of
output.importValue
to it.
Default: - the output is not exported
Copyright © 2023. All rights reserved.