-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: Handle global value for Function CodeUri in Package #1766
Conversation
Need to add tests, may have a refactoring pass as well. This is part of an effort to fix issue aws#1706
resource_type = resource.get("Type", None) | ||
resource_dict = resource.get("Properties", None) | ||
|
||
if "CodeUri" not in resource and resource_type == AWS_SERVERLESS_FUNCTION: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug doesn't state, but DefinitionUri
of Globals->Api
also needs same treatment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will check this with the Layers issue as well.
Does Globals also support Layers? If so, that also will need to be added. |
I believe that Globals would indeed support layers. I'll look in to that. |
Sounds like Globals do not yet support Layers, so no-op there. |
This would actually be a gate for all possible global checks.
Issue #, if available: #1706
Why is this change necessary?
The
sam package
command does not read any global values over the course of packaging - traditionally, only build and deploy functionality would use any values. Issue #1706 points to an uncommon use case that exposes that some global values do need to be considered, at minimum so that package won't break deploy.How does it address the issue?
Creates an
apply_global_values
method that fetches global values we use (currently just the one) and applies them if/when they are applicable.What side effects does this change have?
None
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.