Add support for VPN connection routes #1793
Merged
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.
More resources for #28. I believe this also completely closes out #1011.
The acceptance tests pass locally and docs are included with this PR. I thought briefly about making this a configuration option on the vpn_connection resource but resisted for a few reasons. First, AWS's API makes these distinct calls, and while it's quite frustrating as an AWS API consumer, users of the AWS provider will probably look to CloudFormation or the API docs to determine what resources they need to build when picking up terraform. Additionally, these are static routes over a VPN tunnel, which means that they need to be deliberately added and removed to avoid network interruptions. If we located their update logic inside
resource_aws_vpn_connection.go
, I believe we'd have to delete all rules, then reapply the newly discovered ones, much the way security groups handle ingress/egress. That's really not ideal for this type of resource, hence, I made it its own thing.We can try to protect users from AWS's kludgey API, but only so far. Making this its own resource requires a bit more configuration by the user but will result in a more reliable resource.