open-constructs / aws-cdk-library

Community-Driven CDK Construct Library
Apache License 2.0
58 stars 12 forks source link

(codeartifact) Add support for L2 constructs Domain & Repository #52

Open bweigel opened 4 days ago

bweigel commented 4 days ago

Is your feature request related to a problem? Please describe.

Managing CodeArtifact repositories and domains through AWS CDK currently requires the use of L1 constructs. This makes it harder to manage these resources with a more streamlined, high-level abstraction, resulting in more code and complexity for users who wish to leverage AWS CodeArtifact for package management.

Would you be willing to help with a PR?

Describe the solution you'd like

I propose the creation of L2 construct to manage Repository and Domain resources.

Features could include:

Describe alternatives you've considered

N/A

Additional context

:information_source: This is basically created with AI, from the API.md of the constructs we use internally.

This proposal introduces two core constructs:

Usage

Developers will be able to instantiate these constructs in their CDK applications as follows:

const domain = new Domain(this, 'MyDomain', {
  domainName: 'my-artifacts-domain',
  //(optional) encryptionKey: kmsKey, 
});

const repository = new Repository(this, 'MyRepo', {
  repositoryName: 'my-repo',
  domain: domain,
  description: 'Repository for npm packages',
  externalConnection: RepositoryConnection.NPM,
});
moltar commented 4 days ago

@bweigel I have this as L2 already as well. We can pair on it, if you want.

bweigel commented 4 days ago

@moltar that sounds good! Do you want to share some feedback on my proposal above? Maybe you have some completely different design decisions or thoughts on the interface.

moltar commented 3 days ago

My repo is not public, but I do not mind sharing this part. I'm including the works in a ZIP. But your PR seems to be more comprehensive. Altho I think my zip has some cool bits too.

codeartifact.zip