@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:45.036Z") 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 . |
IConstruct.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnOutput(software.amazon.jsii.JsiiObjectRef objRef) |
|
CfnOutput(software.constructs.Construct scope,
java.lang.String id,
CfnOutputProps props)
Creates an CfnOutput value for this stack.
|
Modifier and Type | Method and Description |
---|---|
CfnCondition |
getCondition()
A condition to associate with this output value.
|
java.lang.String |
getDescription()
A String type that describes the output value.
|
java.lang.String |
getExportName()
The name used to export the value of this output across stacks.
|
java.lang.String |
getImportValue()
Return the `Fn.importValue` expression to import this value into another stack.
|
java.lang.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(java.lang.String value)
A String type that describes the output value.
|
void |
setExportName(java.lang.String value)
The name used to export the value of this output across stacks.
|
void |
setValue(java.lang.Object value)
The value of the property returned by the aws cloudformation describe-stacks command.
|
protected java.util.List<java.lang.String> |
validate()
Validate the current construct.
|
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
protected CfnOutput(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnOutput(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnOutput(software.constructs.Construct scope, java.lang.String id, CfnOutputProps props)
scope
- The parent construct. This parameter is required.id
- This parameter is required.props
- CfnOutput properties. This parameter is required.protected java.util.List<java.lang.String> validate()
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
public java.lang.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.
public java.lang.Object getValue()
The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
public void setValue(java.lang.Object value)
The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
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.
public void setCondition(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.
public java.lang.String getDescription()
The description can be a maximum of 4 K in length.
Default: - No description.
public void setDescription(java.lang.String value)
The description can be a maximum of 4 K in length.
Default: - No description.
public java.lang.String getExportName()
To use the value in another stack, pass the value of
output.importValue
to it.
Default: - the output is not exported
public void setExportName(java.lang.String value)
To use the value in another stack, pass the value of
output.importValue
to it.
Default: - the output is not exported