I'm using CodePipeline and CodeDeploy to automate the deployment process. The code sourcing and docker image build happen outside of AWS. I have a git pipeline outside of AWS that builds/packages a docker image on code push and pushes the docker image to ECR.
As soon as the docker image is pushed to AWS ECR is kicks the AWS pipeline and starts the ECR source stage. The output artifact from this stage can't be passed directly into the deploy stage. It requires an AppSpec file.
{
"version": "0.0",
"Resources": [
{
"awscodestar-gateway-api-lambda-HelloWorld": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Name": "awscodestar-gateway-api-lambda-HelloWorld",
"Alias": "live",
"CurrentVersion": "3",
"TargetVersion": "4"
}
}
}
]
}
I'm not able to figure out how to pass the Docker image URL and AppSpec file to the deploy stage so that it deploys the image to lambda.
The reason for using the CodeDeploy stage for the lambda is it supports blue/green deployment and versioning.
I can't find any docs related to lambda deployment where ECR acts as a source.
Please, let me know if anyone has any workarounds.