This is an AWS CDK Construct to create a new AWS Codeartifact Domain and one or more Repositories
Project description
cdk-codeartifact
CDK Construct to create an AWS Codeartifact repository. Construct combines creating both Domain and one or more Repositories into one construct and also provides an enumerated type for public external connections.
There are some additional validations built-in to ensure the construct will deploy correctly:
- Naming convention checks for Codeartifact Domain Name.
- Naming convention checks for Codeartifact Repository Name.
- Passing in more than 1 external repository will throw an error - only 1 external repository is supported by Codeartifact.
Breaking Changes - Migrating to V1.0.0
Release 1.0.0 introduces breaking changes so any project you have created using pre-1.0.0 of cdk-codeartifact should not be upgraded to this version.
Migrating to Version 1.0.0 will require any existing stacks to be removed before upgrading. The Cloudformation composition synthesized in V1.0.0 has a different composition, which means that Cloudformation will detect a change in how the stack is constructed and will try to delete the existing CodeArtifact domain and/or repositories. This will not be possible if any artifacts have been pushed into the repositories.
The original CodeArtifact construct class has been deprecated and is replaced by the Domain class which better reflects what this code construct is doing. For convenience, a Repository class has been added so that a stand-alone repository can also be created using this library. The Repository class is a simple extension of the CfnRepository class at this stage without any additional functionality.
All Interface Property structures have been renamed to start with a capital "I" to conform to the usual dotnet convention for interface naming, this will assist when cross-compilation is enabled for this construct.
External Connection Type
When adding an External Connection to your CodeArtifact repository ensure to make use of the ExternalRepository
type to define the public external repository comnnection.
export enum ExternalRepository {
NPM = 'public:npmjs',
PYPI = 'public:pypi',
MAVEN_CENTRAL = 'public:msven-central',
MAVEN_GOOGLE_ANDROID = 'public:maven-googleandroid',
MAVEN_GRADLE_PLUGINS = 'public:maven-gradleplugins',
MAVEN_COMMONSWARE = 'public:maven-commonsware',
NUGET = 'public:nuget-org'
}
Currently this construct has been published as an NPM package.
Installation and Usage
Typescript
Installation
$ npm install --save cdk-codeartifact
Usage for CDK V2
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { Domain, ExternalRepository } from 'cdk-codeartifact';
import { Construct } from 'constructs';
export class MyStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps = {}) {
super(scope, id, props);
new Domain(this, id, {
domainName: 'test-domain',
repositories: [{
repositoryName: 'test-repo',
externalConnections: [ExternalRepository.NPM],
},
{
repositoryName: 'test-repo2',
externalConnections: [ExternalRepository.PYPI],
}],
});
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cdk-codeartifact-1.0.4.tar.gz
.
File metadata
- Download URL: cdk-codeartifact-1.0.4.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a044c71352f40803aed06996d895189e30c2ae0ed005fd1803abff8522a9d150 |
|
MD5 | 7df0edffaba92b0aaa969226d8efa458 |
|
BLAKE2b-256 | 8b3a89cb64cb5f0efc825d150f05bdb8832a76be68ce1d4c9f13b9e24d29bfc4 |
File details
Details for the file cdk_codeartifact-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: cdk_codeartifact-1.0.4-py3-none-any.whl
- Upload date:
- Size: 45.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 781bdb25e5b56a76be78bf1ce56cb94db9602c327e26ba917d33ac0b39216cc1 |
|
MD5 | d1b8e64649f6b098391a108c57b72f9e |
|
BLAKE2b-256 | 8f25bb7cc17a5d7c273cd16243a495878036164aea1e001343624d5b3c0621aa |