Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove build golang lambda #535

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

fix: Remove build golang lambda #535

wants to merge 31 commits into from

Conversation

wchaws
Copy link
Contributor

@wchaws wchaws commented Feb 20, 2024

Fixes #222

Test Cases

Test project can be found at https://github.com/cdklabs/cdk-ecr-deployment/blob/dev/test/example.ecr-deployment.ts.
Instructions can be found at https://github.com/cdklabs/cdk-ecr-deployment/tree/dev?tab=readme-ov-file#sample-testexampleecr-deploymentts

1. Copy from local cdk docker image asset to ECR repo.

Prerequisite:

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

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`),
});

2. Copy from a ECR repo to another ECR repo.

Prerequisite:

  1. Two existing ECR repo.
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage1', {
  src: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/AAAAlatest`),
  dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/BBBB:latest`),
});

3. Copy from docker registry to ECR repo.

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`),
});

4. Copy from private docker registry to ECR repo.

Prerequisite:

  1. An existing ECR repo.
  2. A private docker registry and an access token for the registry.
  3. Create a AWS Secrets Manager secret to store the access token. The format must be <username>:<password>.

Notice: The creds parameter can be the secret name or arn of the aws secrets manager in the same cdk stack region.

image
// 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('your-private-docker-registry/nginx:latest', 'username:password'),
  // src: new ecrdeploy.DockerImageName('your-private-docker-registry/nginx:latest', 'aws-secrets-manager-secret-name'),
  // src: new ecrdeploy.DockerImageName('your-private-docker-registry/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: ['*'],
}));

5. Regional test

Select some regions to test if it's able to work

Signed-off-by: github-actions <github-actions@github.com>
@wchaws wchaws changed the title Remove build golang lambda BREAKING CHANGE!: Remove build golang lambda Feb 20, 2024
@wchaws wchaws changed the title BREAKING CHANGE!: Remove build golang lambda fix: Remove build golang lambda Feb 20, 2024
@wchaws wchaws changed the title fix: Remove build golang lambda fix: Remove build golang lambda WIP Feb 20, 2024
@wchaws wchaws changed the title fix: Remove build golang lambda WIP fix: Remove build golang lambda Mar 3, 2024
@wchaws wchaws requested review from kaizencc and scanlonp March 3, 2024 14:32
@wchaws wchaws self-assigned this Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove build golang lambda
1 participant