Skip to content

An AWS lambda function that takes an input artifact from an AWS CodePipeline, unzips it, edits parts of the appspec.yaml, rezips, and returns an output artifact for use by AWS CodePipeline.

Notifications You must be signed in to change notification settings

brandonjbegle/lambda-edit-code-deploy-yaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Edit Appspec.yaml Lambda Function For AWS CodePipeline

Simple python script (Python 3.6 Runtime) that allows for changing the AppSpec.yaml on the fly in case of different configurations for production and development.

How does it work?

  • Copy this code to a lambda function in your AWS account
  • Modify the line that says ‘ destination: XXXXXX’ to match where your code needs to deploy to.
  • Modify the index of the array to match your AppSpec.yaml line. Mine was line 5, thus data[4].
  • Make modifications/remove the script editing portions of the file. This function modifies some shell scripts that were in the application folder based on production/development.
  • Make sure your lambda function has a role that gives it access to the S3 bucket where your input artifact will be stored and CodePipelines so it can update the status to failure or success.

About

An AWS lambda function that takes an input artifact from an AWS CodePipeline, unzips it, edits parts of the appspec.yaml, rezips, and returns an output artifact for use by AWS CodePipeline.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages