Skip to content

feat(codepipeline): add usePipelineRoleForActions field support in L2 #33961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

hwum
Copy link
Contributor

@hwum hwum commented Mar 28, 2025

Issue # 27605

#27605

Reason for this change

Lots of customer reported they don't want such many new roles generated in cdk level.
Current cdk library will help customer to generate a action role if no role configured.
But in Codepipeline backend logic, the pipeline service role will be used as default action role, which the cdk library doesn't align.
This pr will support customer to have more alternatives and won't break anything

Description of changes

add usePipelineRoleForActions field support in L2 construct, and modify the function AddAction and ProduceAction to make sure this flag covers everything needed

Describe any new or updated permissions being added

No

Description of how you validated changes

Unit test/Integ test/local deployment

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team March 28, 2025 08:45
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Mar 28, 2025
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.39%. Comparing base (d02e64a) to head (f4f8e6f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33961   +/-   ##
=======================================
  Coverage   82.39%   82.39%           
=======================================
  Files         120      120           
  Lines        6960     6960           
  Branches     1175     1175           
=======================================
  Hits         5735     5735           
  Misses       1120     1120           
  Partials      105      105           
Flag Coverage Δ
suite.unit 82.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.39% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hwum hwum force-pushed the l2 branch 7 times, most recently from 1419d2c to 9538fba Compare March 28, 2025 21:23
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 28, 2025
});

const stack = new cdk.Stack(app, 'aws-cdk-integ-test-service-roles-for-actions');
const pipelineServiceRole = new iam.Role(stack, 'pipeline-role', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this role used? and I don't see this test using usePipelineRoleForActions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted.

@@ -903,6 +903,10 @@ new codepipeline.Pipeline(this, 'Pipeline', {
});
```

## usePipelineServiceRoleForActions field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super super nit: Avoid having the property name in the title. Title should be descriptive and the content should mention usePipelineRoleForActions.

@hwum hwum force-pushed the l2 branch 6 times, most recently from 797f00f to e435053 Compare March 31, 2025 19:03
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: f4f8e6f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Mar 31, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit d8bbc1c into aws:main Mar 31, 2025
21 checks passed
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants