class StackOutputReference
Language | Type name |
---|---|
.NET | Amazon.CDK.Pipelines.StackOutputReference |
Go | github.com/aws/aws-cdk-go/awscdk/v2/pipelines#StackOutputReference |
Java | software.amazon.awscdk.pipelines.StackOutputReference |
Python | aws_cdk.pipelines.StackOutputReference |
TypeScript (source) | aws-cdk-lib » pipelines » StackOutputReference |
A Reference to a Stack Output.
Example
class MyLambdaStep
extends pipelines.Step
implements pipelines.ICodePipelineActionFactory
{
private stackOutputReference: pipelines.StackOutputReference;
constructor(private readonly fn: lambda.Function, stackOutput: CfnOutput) {
super('MyLambdaStep');
this.stackOutputReference =
pipelines.StackOutputReference.fromCfnOutput(stackOutput);
}
public produceAction(
stage: codepipeline.IStage,
options: pipelines.ProduceActionOptions
): pipelines.CodePipelineActionFactoryResult {
stage.addAction(
new cpactions.LambdaInvokeAction({
actionName: options.actionName,
runOrder: options.runOrder,
// Map the reference to the variable name the CDK has generated for you.
userParameters: {
stackOutput: options.stackOutputsMap.toCodePipeline(
this.stackOutputReference
),
},
lambda: this.fn,
})
);
return { runOrdersConsumed: 1 };
}
/**
* Expose stack output references, letting the CDK know
* we want these variables accessible for this step.
*/
public get consumedStackOutputs(): pipelines.StackOutputReference[] {
return [this.stackOutputReference];
}
}
Properties
Name | Type | Description |
---|---|---|
output | string | Output name of the producing stack. |
stack | string | A human-readable description of the producing stack. |
outputName
Type:
string
Output name of the producing stack.
stackDescription
Type:
string
A human-readable description of the producing stack.
Methods
Name | Description |
---|---|
is | Whether or not this stack output is being produced by the given Stack deployment. |
static from | Create a StackOutputReference that references the given CfnOutput. |
ProducedBy(stack)
ispublic isProducedBy(stack: StackDeployment): boolean
Parameters
- stack
Stack
Deployment
Returns
boolean
Whether or not this stack output is being produced by the given Stack deployment.
CfnOutput(output)
static frompublic static fromCfnOutput(output: CfnOutput): StackOutputReference
Parameters
- output
Cfn
Output
Returns
Create a StackOutputReference that references the given CfnOutput.