interface CfnOutputProps
Language | Type name |
---|---|
.NET | Amazon.CDK.CfnOutputProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2#CfnOutputProps |
Java | software.amazon.awscdk.CfnOutputProps |
Python | aws_cdk.CfnOutputProps |
TypeScript (source) | aws-cdk-lib » CfnOutputProps |
Example
declare const cluster: eks.Cluster;
// add service account
const serviceAccount = cluster.addServiceAccount('MyServiceAccount');
const bucket = new s3.Bucket(this, 'Bucket');
bucket.grantReadWrite(serviceAccount);
const mypod = cluster.addManifest('mypod', {
apiVersion: 'v1',
kind: 'Pod',
metadata: { name: 'mypod' },
spec: {
serviceAccountName: serviceAccount.serviceAccountName,
containers: [
{
name: 'hello',
image: 'paulbouwer/hello-kubernetes:1.5',
ports: [ { containerPort: 8080 } ],
},
],
},
});
// create the resource after the service account.
mypod.node.addDependency(serviceAccount);
// print the IAM role arn for this service account
new CfnOutput(this, 'ServiceAccountIamRole', { value: serviceAccount.role.roleArn });
Properties
Name | Type | Description |
---|---|---|
value | string | The value of the property returned by the aws cloudformation describe-stacks command. |
condition? | Cfn | A condition to associate with this output value. |
description? | string | A String type that describes the output value. |
export | string | The name used to export the value of this output across stacks. |
key? | string | The key of the property returned by aws cloudformation describe-stacks command. |
value
Type:
string
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.
condition?
Type:
Cfn
(optional, default: No condition is associated with the output.)
A condition to associate with this output value.
If the condition evaluates
to false
, this output value will not be included in the stack.
description?
Type:
string
(optional, default: No description.)
A String type that describes the output value.
The description can be a maximum of 4 K in length.
exportName?
Type:
string
(optional, default: the output is not exported)
The name used to export the value of this output across stacks.
To import the value from another stack, use Fn.importValue(exportName)
.
key?
Type:
string
(optional)
The key of the property returned by aws cloudformation describe-stacks command.