aws / aws/aws-cdk

(CodeCommit): a feature to create approval rule templates

Open
#18,254 7 comments 6 reactions 0 assignees View on GitHub
@aws-cdk/aws-codecommit effort/large feature-request feature/coverage-gap needs-cfn p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Description

With current CDK, it is hard to create approval rule templates for CodeCommit repositories and engineers need to use 3rd-party NPM package to simplify it such as CloudComponents.
Although CloudComponents package has cool features that make it simple, I believe CDK can provide same feature with more intuitive interfaces.

### Use Case

Currently I am working on infra stuff with CDK to create CodeCommit repository and related roles and rules.
After creating a repository, I tried to create a approval rule template but I couldn't find the feature with CDK.

In order to find the solution, I searched and found NPM package which is CloudComponents(https://github.com/cloudcomponents/cdk-constructs) and I felt that it seemed kind of tricky to create an approval rule template using current CDK.
Too many steps which are not intuitive and somehow creating lambda functions for approval rule templates seems like being used only once for creating the template.

### Proposed Solution

```ts
// Create a new template
const myTemplate = new codecommit.ApprovalRuleTemplate(scope, 'MyApprovalRuleTemplate' {
approvalRuleTemplateName: 'template name',
description: 'description text',
numberOfApprovalsNeeded: 2,
approverType: {
type: 'IAM user name or assumed role',
value: 'gitUserRole'
},
branches: ["main", "release"]
});

// Associate the template to a repository
myTemplate.associateRepository(repo);
```

### Other information

_No response_

### Acknowledge

- [ ] I may be able to implement this feature request
- [X] This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

The issue names no CDK source file or test; start by locating the existing TypeScript CodeCommit constructs and their tests, then compare the requested ApprovalRuleTemplate API with AWS CodeCommit capabilities and the CloudComponents reference. Done means CDK can create approval rule templates and associate them with repositories through a documented, tested interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.