-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/pipelinesCDK Pipelines libraryCDK Pipelines librarybugThis issue is a bug.This issue is a bug.cause/not-a-bugNot a bug (might still be a documentation issue, might still need work)Not a bug (might still be a documentation issue, might still need work)effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
What is the problem?
Using exportedVariable does not work when using it in a CodePipeline.
Reproduction Steps
Basically, using exportedVariable as an input for LambdaInvokeAction does not work and causes an error Output for step CodeBuildStep(Produce) not configured. Either the step is not in the pipeline, or this engine does not support Outputs for this step.. .
See https://github.com/aws/aws-cdk/pull/19156/files for a full code sample:
class TestLambdaAction extends cdkp.Step implements cdkp.ICodePipelineActionFactory {
constructor (
private readonly scope: Construct,
id: string,
private readonly userParameters?: { [key: string]: any }) {
super(id);
}
public produceAction (stage: codePipeline.IStage, _options: cdkp.ProduceActionOptions): cdkp.CodePipelineActionFactoryResult {
const lambdaPrefix = `arn:aws:lambda:${Stack.of(this.scope).region}:${Stack.of(this.scope).account}`;
const lambdaf = lambda.Function.fromFunctionArn(this.scope, 'Lambda', `${lambdaPrefix}:function:TestLambda`);
stage.addAction(new actions.LambdaInvokeAction({
actionName: 'TestAction',
lambda: lambdaf,
userParameters: this.userParameters,
}));
return { runOrdersConsumed: 1 };
}
}
const producer = new cdkp.CodeBuildStep('Produce', {
commands: ['export MY_VAR=hello'],
});
const consumer = new TestLambdaAction(pipelineStack, 'TestLambda', {
THE_VAR: producer.exportedVariable('MY_VAR'),
});What did you expect to happen?
I would expect to be able to use output in a pipeline step as an input for another pipeline step.
What actually happened?
Error Output for step CodeBuildStep(Produce) not configured. Either the step is not in the pipeline, or this engine does not support Outputs for this step.. .
CDK CLI Version
2.14.0
Framework Version
No response
Node.js Version
14
OS
macOS
Language
Typescript
Language Version
4
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/pipelinesCDK Pipelines libraryCDK Pipelines librarybugThis issue is a bug.This issue is a bug.cause/not-a-bugNot a bug (might still be a documentation issue, might still need work)Not a bug (might still be a documentation issue, might still need work)effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2