Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script repitition when staging lambda artifacts #193

Open
svozza opened this issue Jan 13, 2021 · 2 comments
Open

Script repitition when staging lambda artifacts #193

svozza opened this issue Jan 13, 2021 · 2 comments

Comments

@svozza
Copy link
Contributor

svozza commented Jan 13, 2021

Currently every lambda function has an identical stage.sh file in ach lambda directly, as the number of lambda functions grows this will become much harder to maintain if it ever needs to be changed. We should consolidate the staging in a single script. This will probably involve changing the bundle.sh scripts to all create an output folder name that is common to all lambda functions such as dist rather than the current pattern which is to use a unique name for each function. For example:

# we change this
echo "Building Lambda deployment package"
zip ${PACKAGE_FILE} ${LAMBDA_SOURCE}
zip -gr ${PACKAGE_FILE} pinpoint-templates

# to this

echo "Building Lambda deployment package"
zip ${PACKAGE_FILE} ${LAMBDA_SOURCE}
zip -gr ${PACKAGE_FILE} dist
@svozza svozza changed the title Script repitition when staging lambda arrtifacts Script repitition when staging lambda artifacts Jan 14, 2021
@james-jory
Copy link
Contributor

Agree that this will be a growing maintenance issue over time as the number of Lambdas grow. Other options that have been considered are moving to sam package or aws cloudformation package.

@svozza
Copy link
Contributor Author

svozza commented Jan 21, 2021

So, I looked into SAM and unfortunately you can't use it with nested templates, see this issue: aws/aws-sam-cli#1213. Btw, if you're interested, in my fork I've created a skeleton of how to do API Gateway backed microservices that uses some of the serverless transforms without needing the SAM CLI: svozza#5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants