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

Update template.yaml and make build to support build-time-only resources #201

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

mbklein
Copy link
Contributor

@mbklein mbklein commented Apr 26, 2024

This PR adds some logic to the build/deploy process that allows the SAM template to differ between dev-time and deploy-time. This is done by adding a new kind of comment (#*) to lines that should be part of the build but not included during dev, and having the build command strip those comments out before building.

It also updates dependencies and test invocation to get rid of some deprecation warnings. Most notably, we no longer need AWS SDK v2, which saves nearly 9,000 lines among the the three package-lock.json files alone.

To test:

  1. make clean
  2. Run API locally with make serve
    • Make sure you can use the API without a bunch of layer rebuilds in between, even after modifying a function
  3. Build API with make build
    • Make sure template.yaml is not modified afterward (i.e., put back the way it was)
    • Check .aws-sam/build/apiDependencies to make sure all the runtime dependencies are in there
    • Check other node functions under .aws-sam/build/ to make sure they do not have dependencies
      • Note: This applies only to the main API functions in node, not the functions in lambdas
      • Also Note: There may be directories under these functions' node_modules directory, but they should be empty

Remember to make clean again (or at least rm -rf .aws-sam) to make sure you don't leave the build behind.

@mbklein mbklein requested a review from kdid April 26, 2024 16:03
…sources

Replace `bin/start-local-api` and `bin/start-with-step` with `make serve` and `make start-with-step`
Update dependencies and test invocation to get rid of some deprecation warnings
Split `make serve` into `make serve-http` and `make serve-https` with HTTPS as the default
Update `README.md` with new startup instructions
Copy link
Contributor

@kdid kdid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mbklein mbklein merged commit 8c0c583 into deploy/staging Apr 26, 2024
1 check passed
@mbklein mbklein deleted the 4431-dependency-layer-hack branch April 26, 2024 19:53
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

Successfully merging this pull request may close these issues.

2 participants