-
Notifications
You must be signed in to change notification settings - Fork 18
fix: add deprecation notice for the vpn_gateways input
#1041
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
20f87ed
doc: deprecation update
imprateeksh ec46e30
Merge branch 'main' into deprecate_refs
imprateeksh b89cd4e
Merge branch 'main' into deprecate_refs
imprateeksh 332cc9b
Merge branch 'deprecate_refs' of github.com:terraform-ibm-modules/ter…
imprateeksh 6e10a7a
doc: fixed typos
imprateeksh 89f369a
Merge branch 'main' into deprecate_refs
imprateeksh 61fdf25
Merge branch 'main' into deprecate_refs
imprateeksh f0479e8
Merge branch 'main' into deprecate_refs
imprateeksh 0151638
Merge branch 'main' into deprecate_refs
imprateeksh 26a2741
Merge branch 'main' into deprecate_refs
imprateeksh 336c01f
Merge branch 'main' into deprecate_refs
imprateeksh f23ebe9
Merge branch 'main' into deprecate_refs
imprateeksh a8834ef
Merge branch 'deprecate_refs' of github.com:terraform-ibm-modules/ter…
imprateeksh 723e6c4
fixed typo
imprateeksh eda44a6
Merge branch 'main' into deprecate_refs
imprateeksh 8129d43
updated variable to use default route value and add migration document
imprateeksh 861af94
Merge branch 'main' into deprecate_refs
imprateeksh 05872ef
addressed review suggestions
imprateeksh 5dd85b3
Merge branch 'main' into deprecate_refs
imprateeksh 090f82b
Merge branch 'main' into deprecate_refs
imprateeksh c50cc19
added deprecation warning block
imprateeksh 85734d8
Merge branch 'deprecate_refs' of github.com:terraform-ibm-modules/ter…
imprateeksh 9103a35
updated doc
imprateeksh 4f06f04
addressed comments
imprateeksh 8bc632c
fixed warning block
imprateeksh 7993351
test: updated test case to ignore deprecation resource
imprateeksh 2e4ac8b
test: updated test case to ignore deprecation resource
imprateeksh f3b9e18
Merge branch 'main' into deprecate_refs
imprateeksh 882ce48
test: updated test with ignore attributes
imprateeksh ba282f2
Merge branch 'main' into deprecate_refs
imprateeksh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # VPN Gateway migration steps | ||
|
|
||
| ## VPN Gateway changes in `v9.0.0` | ||
|
|
||
| * Starting with version `v9.0.0`, direct use of the VPN gateway in the main setup will be **removed**. | ||
| * Instead of defining the VPN gateway resources, reference the [`terraform-ibm-modules/site-to-site-vpn`](https://github.com/terraform-ibm-modules/terraform-ibm-site-to-site-vpn) module. | ||
| * Users must migrate their Terraform state and update outputs to avoid resource recreation and broken references. | ||
|
|
||
| ## Overview | ||
|
|
||
| This change improves maintainability and consistency by consolidating VPN gateway logic into a dedicated module. | ||
| Because resource addresses and outputs have changed, you must migrate your Terraform state and update any dependent references. | ||
|
|
||
| This release introduces the following changes: | ||
|
|
||
| 1. Resource address migration (using `terraform state mv` and new helper resources). | ||
| 2. Output block changes (deprecation of `vpn_gateways_name` and link to new outputs). | ||
|
|
||
| ## Resource Address Migration | ||
|
|
||
| The module to create VPN gateways can now be used as shown in the below example. | ||
|
|
||
| ```hcl | ||
| module "vpn_gateways" { | ||
| source = "terraform-ibm-modules/site-to-site-vpn/ibm" | ||
| version = "3.0.4" # Replace with the version of site to site VPN Module | ||
| for_each = { | ||
| vpn_gw_1 = { | ||
| resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with your resource group id. | ||
| name = "gateway-1" | ||
| mode = "route" | ||
| subnet_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with the subnet id where VPN Gateway will be created. | ||
| } | ||
| vpn_gw_2 = { | ||
| resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with your resource group id. | ||
| name = "gateway-2" | ||
| mode = "policy" | ||
| subnet_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with the subnet id where VPN Gateway will be created. | ||
| } | ||
| } | ||
| resource_group_id = each.value.resource_group_id | ||
| vpn_gateway_name = each.value.name | ||
| vpn_gateway_subnet_id = each.value.subnet_id | ||
| vpn_gateway_mode = each.value.mode | ||
| } | ||
| ``` | ||
|
|
||
| **Resource address (current):** `module.<module-name>.ibm_is_vpn_gateway.vpn_gateway["<gateway-name>"]` | ||
| **Resource address (after migration):** `module.<module-name>.module.vpn_gateways["<gateway-name>"]`.ibm_is_vpn_gateway.vpn_gateway[0]` | ||
|
|
||
| ## Migration Command | ||
|
|
||
| If you are upgrading an existing environment, you need to tell Terraform that the resource has moved so it doesn’t try to recreate it. | ||
|
|
||
| **Option 1: Using moved block :** | ||
|
|
||
| ```hcl | ||
| moved { | ||
| from = module.<module-name>.ibm_is_vpn_gateway.vpn_gateway["gateway-1"] | ||
| to = module.<module-name>.module.vpn_gateways["gateway-1"].ibm_is_vpn_gateway.vpn_gateway[0] | ||
| } | ||
| ``` | ||
|
|
||
| **Option 2: Using terraform state mv (manual alternative):** | ||
|
|
||
| Use the terraform state mv command to migrate each gateway: | ||
|
|
||
| ```sh | ||
| terraform state mv 'module.<module-name>.ibm_is_vpn_gateway.vpn_gateway[<gateway-name>]' 'module.<module-name>.module.vpn_gateways[<gateway-name>].ibm_is_vpn_gateway.vpn_gateway[0]' | ||
| ``` | ||
|
|
||
| **Example:** | ||
|
|
||
| If the name of `vpn_gateway` is `gateway-1`, i.e. | ||
|
|
||
| ```hcl | ||
| vpn_gateways = [{ | ||
| name = "gateway-1" | ||
| subnet_name = "subnet-a" | ||
| }] | ||
| ``` | ||
|
|
||
| Then terraform state moved command that can be used is: | ||
|
|
||
| ```sh | ||
| terraform state mv 'module.<module-name>.ibm_is_vpn_gateway.vpn_gateway["gateway-1"]' 'module.<module-name>.module.vpn_gateways["gateway-1"].ibm_is_vpn_gateway.vpn_gateway[0]' | ||
| ``` | ||
|
|
||
| ## New Resources | ||
|
|
||
| The vpn_gateways module introduces helper resources (e.g., `time_sleep.wait_for_gateway_creation`). This is new and will be created automatically on the next apply. No migration is required. | ||
|
|
||
| ## Output block changes | ||
|
|
||
| * The `site‑to‑site-vpn` module does not expose VPN names directly thus the output `vpn_gateways_name` will no longer be available. | ||
|
|
||
| * The existing `vpn_gateways_data` will be updated to consume the module, i.e. | ||
|
|
||
| ``` hcl | ||
| output "vpn_gateways_data" { | ||
| description = "Details of VPN gateways data." | ||
| value = [ | ||
| for gateway in module.vpn_gateways : gateway | ||
| ] | ||
| } | ||
| ``` | ||
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.