StackOutputReference

class aws_cdk.pipelines.StackOutputReference(*args: Any, **kwargs)

Bases: object

A Reference to a Stack Output.

ExampleMetadata:

infused

Example:

@jsii.implements(pipelines.ICodePipelineActionFactory)
class MyLambdaStep(pipelines.Step):

    def __init__(self, fn, stack_output):
        super().__init__("MyLambdaStep")
        self.stack_output_reference = pipelines.StackOutputReference.from_cfn_output(stack_output)

    def produce_action(self, stage, *, scope, actionName, runOrder, variablesNamespace=None, artifacts, fallbackArtifact=None, pipeline, codeBuildDefaults=None, beforeSelfMutation=None, stackOutputsMap):

        stage.add_action(cpactions.LambdaInvokeAction(
            action_name=action_name,
            run_order=run_order,
            # Map the reference to the variable name the CDK has generated for you.
            user_parameters={"stack_output": stack_outputs_map.to_code_pipeline(self.stack_output_reference)},
            lambda_=self.fn
        ))

        return pipelines.CodePipelineActionFactoryResult(run_orders_consumed=1)public get consumedStackOutputs(): pipelines.StackOutputReference[] {
        return [this.stackOutputReference];
      }

Methods

is_produced_by(stack)

Whether or not this stack output is being produced by the given Stack deployment.

Parameters:

stack (StackDeployment) –

Return type:

bool

Attributes

output_name

Output name of the producing stack.

stack_description

A human-readable description of the producing stack.

Static Methods

classmethod from_cfn_output(output)

Create a StackOutputReference that references the given CfnOutput.

Parameters:

output (CfnOutput) –

Return type:

StackOutputReference