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.
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 { CodeArtifact, 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 CodeArtifact(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
Hashes for cdk_codeartifact-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38067f08701ffcb2506425e8066b6074ab30791d2a8cc12f7ee4d1e51c4d1a81 |
|
MD5 | 74cf56aebeb7175ceeb5f2c704b6f243 |
|
BLAKE2b-256 | 2c5c0a667bb6bcd705afc341fb12f0cee46bec3db262043e9ae1815867a9ac7f |