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 年前檢視次數 214 次
1 個回答
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
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南