0

I can't seem to set up a pipeline that uses CodeDeploy for a lambda function. I have tried:

  1. Generating the appspec.yml file as part of a CodeBuild action. In this case CodePipeline zips the file, and CodeDeploy says it can't find the appspec file.

  2. Generating the appspec.yml file manually (Lambda invocation). In this case CodeDeploy gives the error "The deployment specifies that the revision is a null file, but the revision provided is a zip file." (It is definitely not a zip file)

Has anyone succeeded in doing this?

Note: I know SAM apparently does this. But it would be difficult to introduce new tooling at this point...

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
chickenpie
  • 143
  • 4
  • Have you verified that the 'CodePipeline zip' has the file? – Marcin Jan 15 '22 at 23:18
  • Yes the zip has the appspec file. I think the problem is that CodeDeploy for Lambda specifically wants a json or yaml file, and does not support a zip bundle. So far all my research points to this just being impossible – chickenpie Jan 17 '22 at 17:15
  • Hey @chickenpie, have you managed to figure out how to do deployments via aws cli? – davids May 03 '22 at 10:10
  • 1
    @davids No, not using the cli. I ended up using lambda actions in CodePipeline to do the 3 steps I needed: Publish the new lambda version from latest, generate the appspec file with the old and new version, and call CodeDeploy to do the canary deployment. – chickenpie May 04 '22 at 20:13
  • @chickenpie I was wondering whether the appspec file is needed for Lambda deployments. In the docs, it says that the revision can be specified as a string parameter: --revision '{"revisionType": "String", "string": {"content":"revision-as-string"}}'. It's also true that the appspec files contains information about hooks, for example, but those details would be already available in the DeploymentGroup – davids May 06 '22 at 09:27
  • I was not using the cli so I don't really know about its parameters. Maybe you dont need an appspec file with the cli. – chickenpie May 09 '22 at 13:40

0 Answers0