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

Add config option to avoid automatically deleting an APIGW domain when other base path mappings exist #389

Closed
wants to merge 5 commits into from

Conversation

straticJeff
Copy link

Feature request: Add config option to avoid automatically deleting an APIGW domain when other base path mappings exist

When autoDomain is set to true in this plugin, running sls remove on a deployed service will remove the APIGW custom domain regardless of whether base path mappings exist other than the one the plugin defines for this service.

This change introduces a preserveExternalPathMappings config option to check for other path mappings - either defined through this plugin in other services, or otherwise externally - before removing the custom domain.

When this is enabled, in a scenario where n>1 deployed services use this plugin, and are set to the same customDomain.domainName, the n...n-1 services to be removed should NOT remove the custom domain, whereas the nth will.

@sonarcloud
Copy link

sonarcloud bot commented Sep 24, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@@ -137,6 +137,7 @@ securityPolicy | tls_1_2 | The security policy to apply to the custom domain nam
allowPathMatching | false | When updating an existing api mapping this will match on the basePath instead of the API ID to find existing mappings for an upsate. This should only be used when changing API types. For example, migrating a REST API to an HTTP API. See Changing API Types for more information. |
| autoDomain | `false` | Toggles whether or not the plugin will run `create_domain/delete_domain` as part of `sls deploy/remove` so that multiple commands are not required. |
| autoDomainWaitFor | `120` | How long to wait for create_domain to finish before starting deployment if domain does not exist immediately. |
| preserveExternalPathMappings | `false` | When `autoDomain` is set to true, and a deployment is removed, setting this wto `true` checks for additional API Gateway base path mappings before automatically deleting the domain, and avoids doing so if they exist. |

Choose a reason for hiding this comment

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

typo wto should be to

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

2 participants