Lambda Deployment - Do you have to set the TargetVersion?

1

So I have a CodeBuild project that uploads my latest code to the $latest Lambda version, then publishes a new Lambda version and then does a string replacement on the CodeDeploys appspec file to set the CurrentVersion and the TargetVersion. This works for basic stuff but if say there are 2 people working on the Lambda code and 2 CodeBuilds get kicked off, you will end up with 2 sets of appspec files e.g.

Appspec1: CurrentVersion: 1 TargetVersion: 2

Appspec2: CurrentVersion: 1 TargetVersion: 3

So when Appspec1 is deployed all goes well and the CurrentVersion becomes 2. But then when Appspec2 gets deployed, it will fail because the CurrentVersion is set to 1 instead of the now new version 2.

So how do people get around this? Do you have to set the versions or can CodeDeploy figure it out for itself somehow?

demandé il y a 2 ans112 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions