aws / aws/aws-cdk

(pipelines): (unable to share role between the automatic assets generation codebuild projects)

Open
#22,686 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-codepipeline bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

If you have a stage that generates a lot of assets, the codepipeline role policy will get tons of stuff like this:

```
{
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::XXXXX:role/asset1dockerassets10",
"Effect": "Allow"
}
```

eventually it falls appart and fails with: "Maximum policy size of 10240 bytes exceeded for ..."

It should be possible to pass a role when configuring the codepipeline, used for asset-generation (or pr account) or just a flag: "optOutOfLeastPrivilegeForAssetGeneration"

### Expected Behavior

The generated CF-stack not to increase with every new generated asset.

### Current Behavior

The generated CF-stack increases with every asset added to a pipeline stage.

### Reproduction Steps

create a codepipelinestack and observe that a role is generated for each stage asset.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.49.0

### Framework Version

_No response_

### Node.js Version

not relevant

### OS

not relevant

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with a codepipelinestack containing many assets and inspect the generated CF-stack and CodePipeline role policy. Determine whether the intended fix is a shared asset-generation role or an opt-out flag, then verify that adding assets no longer causes the policy to exceed the 10240-byte limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
ci-cd, cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.