Skip to main content

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

cdk_codeartifact-1.1.1.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_codeartifact-1.1.1-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file cdk_codeartifact-1.1.1.tar.gz.

File metadata

  • Download URL: cdk_codeartifact-1.1.1.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.0

File hashes

Hashes for cdk_codeartifact-1.1.1.tar.gz
Algorithm Hash digest
SHA256 54591f3267499168c1f054dd7c2f6c1e1fc23a7887ee9ba8764225cc34bf9121
MD5 573d134c7171ae000fc74351f45f35f6
BLAKE2b-256 bdd9d75c3341759956a9358fcefc009df96acbd8917a53ac8cbd53f71e16fcbd

See more details on using hashes here.

File details

Details for the file cdk_codeartifact-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cdk_codeartifact-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 431d2c8c02a7b4f0eb4c583ed0edc2a4cb7d89217c290ecc3ca346d55af005c9
MD5 d22a1679a21bbb9c0afe0a4b06420e6e
BLAKE2b-256 94cb04aaa45957b81670380c27f1eeaf7636be28d70e334aabceab70fcd5341f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page