All Projects → cdklabs → cdk-ecr-deployment

cdklabs / cdk-ecr-deployment

Licence: Apache-2.0 license
A CDK construct to deploy docker image to Amazon ECR

Programming Languages

go
31211 projects - #10 most used programming language
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to cdk-ecr-deployment

Cloud-PAW-Management
Simplify PAW and SPA for the masses, unify the MS Internal, and public PAW specs, and expedite deployment to ~5min or less.
Stars: ✭ 45 (-11.76%)
Mutual labels:  deployment
random-dose-of-knowledge
Using the latest Software Engineering practices to create a modern and simple app.
Stars: ✭ 26 (-49.02%)
Mutual labels:  deployment
useful-playbooks
🚚 Useful Ansible playbooks for easily deploy your website or webapp to absolutely fresh remote virtual server and automation many processes. Only 3 minutes from the playbook run to complete setup server and start it.
Stars: ✭ 52 (+1.96%)
Mutual labels:  deployment
batou
batou is a universal, fractal deployment utility using Python.
Stars: ✭ 37 (-27.45%)
Mutual labels:  deployment
kuberay
A toolkit to run Ray applications on Kubernetes
Stars: ✭ 146 (+186.27%)
Mutual labels:  deployment
citylines
Citylines.co is a collaborative platform for mapping the transit systems of the world!
Stars: ✭ 53 (+3.92%)
Mutual labels:  transport
gcloud-deploy-tutorial
How to continuously deploy a Full Stack React +Node.js +MySql App to Google Cloud Compute Engine
Stars: ✭ 19 (-62.75%)
Mutual labels:  deployment
deployer
a Go docker-compose multi-stages deployer.
Stars: ✭ 24 (-52.94%)
Mutual labels:  deployment
configurator
Synchronize and Version Control ConfigMaps & Secrets across Deployment Rollouts.
Stars: ✭ 68 (+33.33%)
Mutual labels:  deployment
gitpack
Git-based package manager written in POSIX shell
Stars: ✭ 72 (+41.18%)
Mutual labels:  deployment
waspy
WASP framework for Python
Stars: ✭ 43 (-15.69%)
Mutual labels:  transport
simple-nft-marketplace
This project provides sample codes to build a simple NFT marketplace with Amazon Managed Blockchain.
Stars: ✭ 59 (+15.69%)
Mutual labels:  cdk
public-transit-tools
Tools for working with GTFS public transit data in ArcGIS
Stars: ✭ 126 (+147.06%)
Mutual labels:  transport
cdk pywrapper
A Python wrapper for the Chemistry Development Kit (CDK)
Stars: ✭ 25 (-50.98%)
Mutual labels:  cdk
buffalo-heroku
Archived use github.com/gobuffalo/buffalo-heroku
Stars: ✭ 16 (-68.63%)
Mutual labels:  deployment
evolution
Evolution process of The Falco Project
Stars: ✭ 37 (-27.45%)
Mutual labels:  deployment
deployadactyl
Make deployment downtime extinct
Stars: ✭ 81 (+58.82%)
Mutual labels:  deployment
librephotos-docker
You can find here the Dockerfiles for the automated build process of LibrePhotos.
Stars: ✭ 81 (+58.82%)
Mutual labels:  deployment
cdkdx
Zero-config CLI for aws cdk development
Stars: ✭ 31 (-39.22%)
Mutual labels:  cdk
server-instant-start
Spin up a fully configured Ubuntu/Debian-based web server in under 10 minutes with Nginx (w/ HTTPS), PHP FPM, Postfix, OpenDKIM, MySQL/MariaDB, PostgreSQL, and more. Deploy your web application too.
Stars: ✭ 17 (-66.67%)
Mutual labels:  deployment

cdk-ecr-deployment

Release npm version PyPI npm PyPI - Downloads

CDK construct to synchronize single docker image between docker registries.

⚠️ Please use ^1.0.0 for cdk version 1.x.x, use ^2.0.0 for cdk version 2.x.x

Features

  • Copy image from ECR/external registry to (another) ECR/external registry
  • Copy an archive tarball image from s3 to ECR/external registry

Environment variables

Enable flags: true, 1. e.g. export CI=1

  • CI indicate if it's CI environment. This flag will enable building lambda from scratch.
  • NO_PREBUILT_LAMBDA disable using prebuilt lambda.
  • FORCE_PREBUILT_LAMBDA force using prebuilt lambda.

⚠️ If you want to force using prebuilt lambda in CI environment to reduce build time. Try export FORCE_PREBUILT_LAMBDA=1.

⚠️ The above flags are only available in cdk-ecr-deployment 2.x.

Examples

import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
import * as ecrdeploy from 'cdk-ecr-deployment';

const image = new DockerImageAsset(this, 'CDKDockerImage', {
  directory: path.join(__dirname, 'docker'),
});

// Copy from cdk docker image asset to another ECR.
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage1', {
  src: new ecrdeploy.DockerImageName(image.imageUri),
  dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/my-nginx:latest`),
});

// Copy from docker registry to ECR.
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage2', {
  src: new ecrdeploy.DockerImageName('nginx:latest'),
  dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/my-nginx2:latest`),
});

// Copy from private docker registry to ECR.
// The format of secret in aws secrets manager must be plain text! e.g. <username>:<password>
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage3', {
  src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'username:password'),
  // src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'aws-secrets-manager-secret-name'),
  // src: new ecrdeploy.DockerImageName('javacs3/nginx:latest', 'arn:aws:secretsmanager:us-west-2:000000000000:secret:id'),
  dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/my-nginx3:latest`),
}).addToPrincipalPolicy(new iam.PolicyStatement({
  effect: iam.Effect.ALLOW,
  actions: [
    'secretsmanager:GetSecretValue',
  ],
  resources: ['*'],
}));

Sample: test/integ.ecr-deployment.ts

# Run the following command to try the sample.
NO_PREBUILT_LAMBDA=1 npx cdk deploy -a "npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/integ.ecr-deployment.ts"

API

Tech Details & Contribution

The core of this project relies on containers/image which is used by Skopeo. Please take a look at those projects before contribution.

To support a new docker image source(like docker tarball in s3), you need to implement image transport interface. You could take a look at docker-archive transport for a good start.

To test the lambda folder, make test.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].