aws / aws/aws-cdk

(pipelines): UpdatePipeline - SelfMutate action injects stack name instead of the stack id

Open
#19,350 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/pipelines bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### What is the problem?

I ran into an issue where the UpdatePipeline - SelfMutate action failed. In my situation the Stack Id is different from the Stack Name. Looking at the generated CodeBuild commands I saw that it injected the stackName instead of the stackId. I believe the CDK cli requires a stack id to select the correct stack.

This line is wrong I think:
See https://github.com/aws/aws-cdk/blob/3382e997067f7e9f98ba98f618402b48bea838b9/packages/%40aws-cdk/pipelines/lib/codepipeline/codepipeline.ts#L619

https://github.com/aws/aws-cdk/blob/3382e997067f7e9f98ba98f618402b48bea838b9/packages/%40aws-cdk/pipelines/lib/codepipeline/codepipeline.ts#L628

### Reproduction Steps

Create a pipeline in a stack where the stack id is different from the stack name.
Change the pipeline so it has to do a self update

### What did you expect to happen?

The pipeline should update after a change

### What actually happened?

The UpdatePipeline - SelfMutate action fails because it cannot find the stack in the assembly

### CDK CLI Version

2.15.0

### Framework Version

_No response_

### Node.js Version

14

### OS

Amazon Linux

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts at the referenced lines 619 and 628, then reproduce the failure with a pipeline whose stack ID differs from its stack name. Verify the generated CodeBuild commands and confirm that self-mutation succeeds and finds the stack in the assembly.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.