Issue with codepipeline and CDK for lambda deployment

0

Hi team, I am trying to build CI/CD codepipeline for lambda deployment using CDK. In this pipeline, I've create source and codebuild stage. In codebuild stage, I am building and pushing docker image to ECR repository which is attached to lambda. After build stage, I want to create code deploy stage which should deploy latest ecr image tag in lambda. But lambda function is created in a pipeline named as "provision-infra", this "provision-infra" build all stacks including codepipeline for lambda deployment.

I tried to create lambdaDeploymentGroup but not able to see a way to trigger codedeploy stage.

1 Resposta
0

Hello,

I've seen this kind of setup/arrangements handled in the Codebuild/Buildspec step itself

i.e. Add the build, deploy, and package steps in the Build command of the buildspec.yml file

build:
    commands:
      - echo "Building the Docker image....."
      - docker build -t app/<app_name> .
      - docker tag app/<app_name> <aws_acct_id>.dkr.ecr.<aws_region>.amazonaws.com/app/<app_name>$COMMIT_SHA
      - docker push <aws_acct_id>.dkr.ecr.<aws_region>.amazonaws.com/app/<app_name>$COMMIT_SHA
      - echo "Build finished and image pushed on `date`"

You can then use the latest SHA/Tag of the ECR image to update lambda deployment.

HTH

profile picture
respondido há 9 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas