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

Allow user to customize naming convention #1927

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MacHu-GWU
Copy link

Issue #, if available:

#1926

Description of changes:

Replace the hard coded naming convention string template %s-%s-%s (...) with constant variable in constants.py module.

# content of constants.py
DEFAULT_LAMBDA_NAME_PREFIX_CONVENTION = "{app_name}-{chalice_stage}"
DEFAULT_LAMBDA_FUNC_NAME_CONVENTION = "{app_name}-{chalice_stage}-{func_name}"
DEFAULT_LAMBDA_LAYER_NAME_CONVENTION = "{app_name}-{chalice_stage}-{layer_name}"
DEFAULT_LAMBDA_ROLE_NAME_CONVENTION = "{app_name}-{chalice_stage}-{func_name}"
DEFAULT_LAMBDA_DEFAULT_ROLE_NAME_CONVENTION = "{app_name}-{chalice_stage}"
DEFAULT_EVENT_RULE_NAME_CONVENTION = "{app_name}-{chalice_stage}-{resource_name}"

As a result, user can do this to customize the function naming convention

# monkey patch
from chalice import constants
constants.DEFAULT_LAMBDA_FUNC_NAME_CONVENTION = "{chalice_stage}-{app_name}-{func_name}"

from chalice import Chalice

...

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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.

None yet

1 participant