This repository was archived by the owner on May 13, 2021. It is now read-only.
Add support for multiple HUB's (one HUB per region) #14
Open
andyfase wants to merge 1 commit intoawslabs:masterfrom
Open
Add support for multiple HUB's (one HUB per region) #14andyfase wants to merge 1 commit intoawslabs:masterfrom
andyfase wants to merge 1 commit intoawslabs:masterfrom
Conversation
…ag value of the VGW to specify the HUB region that the VPN connection should be established too. Fixes race condition where whichever regions lambda function is triggered first will pick up the tagged VGW and claim it.
|
Thanks for your contribution. This PR will be evaluated for the next version and we'll update to this thread once we have more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current poller script contains several race conditions in the use case where a hub is required in different regions. If the Transit VPC stack is created in multiple regions currently then it is not possible to control (for a given VPC/VGW) which hub in which region the VPN connection will be created for.
This pull request makes modifications to the poller script to remove these race conditions by extending the use of the value of
HUB_TAGbeyond the default "true" setting.With this PR the HUB_TAG value can now be:
us-east-1,us-west-2,ca-central-1etcIf the the value of
HUB_TAGis a AWS region then the poller function will ONLY operate on the found VGW is its tagged with the same AWS region that the lambda function is working on. This allows VGW's to be targeted towards specific hub's by the value of the tag.If the VGW is tagged with
HUB_TAG_VALUEthen the behavior of the lambda function is unchanged.The lambda function has been modified in the following ways
isValidRegionadded to determine if a given string is a valid AWS regionAWS_DEFAULT_REGION)updateConfigXMLfunction to set "create" mode if value of HUB_TAG is a valid AWS regionTesting performed
trueon separate VGW's across multiple regions to confirm behavior unchanged in this use-case