-
Notifications
You must be signed in to change notification settings - Fork 4.9k
azurerm_site_recovery_replicated_vm
- deprecate network_interace.target_*
property, add network_interface.ip_configuration.*
#30562
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
base: main
Are you sure you want to change the base?
Conversation
…target_*`, support `network_interface.ip_configuration`
convert to draft since working on tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ziyeqf, I've left a couple comments inline
@@ -294,18 +295,20 @@ func resourceSiteRecoveryReplicatedVM() *pluginsdk.Resource { | |||
}, | |||
|
|||
"network_interface": { | |||
Type: pluginsdk.TypeSet, // use set to avoid diff caused by different orders. | |||
Type: pluginsdk.TypeList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing this?
ValidateFunc: azure.ValidateResourceID, | ||
}, | ||
|
||
"is_primary": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this to primary
? Following our documented naming conventions of avoiding redundant verbs (ref)
"is_primary": { | |
"primary": { |
|
||
"recovery_public_ip_address_id": { | ||
if !features.FivePointOh() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add ConflictsWith
to ensure users don't use the deprecated args in combination with the new ip_configuration
block?
nicSchema.Schema["ip_configuration"].Computed = true | ||
|
||
nicSchema.Schema["failover_test_static_ip"] = &pluginsdk.Schema{ | ||
Deprecated: "this property has been deprecated in favour of `network_interface.ip_configuration`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update each of these deprecation messages to point to the exact replacement property, and to include that they will be removed in 5.0?
Deprecated: "this property has been deprecated in favour of `network_interface.ip_configuration`", | |
Deprecated: "this property has been deprecated in favour of `network_interface.ip_configuration.failover_test_static_ip` and will be removed in v5.0 of the AzureRM provider", |
nicSchema.Schema["failover_test_subnet_name"] = &pluginsdk.Schema{ | ||
Deprecated: "this property has been deprecated in favour of `network_interface.ip_configuration`", | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
} | ||
|
||
nicSchema.Schema["failover_test_subnet_name"] = &pluginsdk.Schema{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These appear to be duplicates
### `azurerm_site_recovery_replicated_vm` | ||
|
||
* The property `network_interface.target_static_ip` has been removed in favour of the `network_interface.ip_configuration.target_statc_ip` property. | ||
* The property `network_interface.target_subnet_name` has been removed in favour of the `network_interface.ip_configuration.target_static_ip` property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mismatched props
* The property `network_interface.target_subnet_name` has been removed in favour of the `network_interface.ip_configuration.target_static_ip` property. | |
* The property `network_interface.target_subnet_name` has been removed in favour of the `network_interface.ip_configuration.target_subnet_name` property. |
* The property `network_interface.recovery_load_balancer_backend_address_pool_ids` has been removed in favour of the `network_interface.ip_configuration.recovery_load_balancer_backend_address_pool_ids` property. | ||
* The property `network_interface.recovery_public_ip_address_id` has been removed in favour of the `network_interface.ip_configuration.recovery_public_ip_address_id` property. | ||
* The property `network_interface.ip_configuration.name` is a new required property, it must be as same as the name of the ip configuration of network interface from the source VM. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing some of the deprecated items
@@ -306,6 +307,16 @@ A `network_interface` block supports the following: | |||
|
|||
* `source_network_interface_id` - (Optional) (Required if the network_interface block is specified) Id source network interface. | |||
|
|||
* `ip_configuration` - (Optional) IP configuration to assign when a failover is done. One or more `ip_configuration` block as defined below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `ip_configuration` - (Optional) IP configuration to assign when a failover is done. One or more `ip_configuration` block as defined below. | |
* `ip_configuration` - (Optional) IP configuration to assign when a failover is done. One or more `ip_configuration` blocks as defined below. |
|
||
The `ip_configuration` block supports the following: | ||
|
||
* `name` - (Required) Name of the IP configuration, must be consistent with the name of IP configuration of source VM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
* `name` - (Required) Name of the IP configuration, must be consistent with the name of IP configuration of source VM. | |
* `name` - (Required) Name of the IP configuration, must be consistent with the name of the IP configuration of the source virtual machine. |
|
||
* `name` - (Required) Name of the IP configuration, must be consistent with the name of IP configuration of source VM. | ||
|
||
* `is_primary` - (Optional) Whether this IP configuration is primary? Must be specified if there is more than 1 `ip_configuration`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously isPrimary
was hardcoded to true
since only 1 IP config could could be specified, what's the behaviour if only 1 ip_configuration
block is specified without setting is_primary = true
?
I noticed in the tests that all of them have marked at least 1 ip_configuration
block with is_primary = true
but since it's optional we should confirm whether omitting it entirely is possible
Community Note
Description
As the IP configuration for a nic could be a list, we only supported one before. There is a issue with high thumbs up asking for supporting for secondary ip configuration. To support it, invovled a new block
network_interface.ip_configuration
and deprecate the old ones.PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
These failed ones are also failing on main branch, shall be not related to this PR.
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.target_static_ip
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.target_subnet_name
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.recovery_load_balancer_backend_address_pool_ids
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.recovery_public_ip_address_id
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.failover_test_static_ip
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.failover_test_subnet_name
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- deprecatenetwork_interface.failover_test_public_ip_addresss_id
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.target_static_ip
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.target_subnet_name
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.recovery_load_balancer_backend_address_pool_ids
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.recovery_public_ip_address_id
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.failover_test_static_ip
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.failover_test_subnet_name
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]azurerm_site_recovery_replicated_vm
- supportnetwork_interface.ip_configuration.failover_test_public_ip_addresss_id
[azurerm_site_recovery_replicated_vm
- deprecatenetwork_interace.target_*
property, addnetwork_interface.ip_configuration.*
#28833]This is a (please select all that apply):
Related Issue(s)
Fixes #28773
Note
If this PR changes meaningfully during the course of review please update the title and description as required.