I'm unable to use AWS CodeDeploy for Lambda via Bitbucket Pipelines. It's saying that the bundle needs to be YAML or JSON, but the documentation and examples indicate that I need to create a zip file. Can anyone give me some guidance here? Details follow.
Version of pipe: atlassian/aws-code-deploy:0.5.2
Steps to reproduce: Pushing changes to master branch, triggering a pipeline job.
I created my pipeline file using this documentation.
bitbucket-pipelines.yml:
pipelines:
default:
- step:
name: Build and package
script:
- apt-get update && apt-get install -y zip
- zip myapp.zip lambda_function.py appspec.yaml
artifacts:
- myapp.zip
- step:
name: Upload lambda zip
script:
- pipe: atlassian/aws-code-deploy:0.5.2
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
COMMAND: 'upload'
APPLICATION_NAME: $APPLICATION_NAME
ZIP_FILE: 'myapp.zip'
Relevant Build Log:
<span><br></span><span>INFO: Registering a revision for the artifact.</span><span>aws deploy register-application-revision --application-name <app-name> --revision revisionType=S3,s3Location={bucket=<bucket>,key=<key>,bundleType=zip}<br></span><span>An error occurred (InvalidRevisionException) when calling the RegisterApplicationRevision operation: BundleType must be either YAML or JSON</span><span>aws s3 cp <a href="http://myapp.zip" target="_blank" rel="noopener nofollow noreferrer">myapp.zip</a> s3://<bucket>/<key></span>