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

azurerm_site_recovery_protection_container_mapping - support automatic_update_extension.automatic_update_extensions_enabled and automatic_update_extension.automation_account_id properties #19710

Merged
merged 16 commits into from
Jan 30, 2023

Conversation

ziyeqf
Copy link
Contributor

@ziyeqf ziyeqf commented Dec 16, 2022

closes #19691
closes #19407

Test

TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryProtectionContainerMapping -timeout=60m            [ tengzh/issue/vault_auto_update][$!][🐹 v1.19.4][⏱ 22m11s][16:57:14]
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_basic
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_basic
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_basic
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_basic (884.46s)
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension (1268.62s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1269.810s

@ziyeqf ziyeqf changed the title azurerm_site_recovery_protection_container_mapping - add auto update extension settings azurerm_site_recovery_protection_container_mapping - support automatic_update_extensions_enabled and automation_account_id properties Dec 16, 2022
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @ziyeqf, thanks for this PR. It's mostly good but I think that we could lump these two attributes into a TypeList instead.

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Dec 19, 2022

Test after modification

TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryProtectionContainerMapping -timeout=60m
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_basic
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_basic
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_basic
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_basic (886.50s)
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension (1229.09s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1230.260s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

One comment left inline

@ziyeqf ziyeqf changed the title azurerm_site_recovery_protection_container_mapping - support automatic_update_extensions_enabled and automation_account_id properties azurerm_site_recovery_protection_container_mapping - support automatic_update_extension.automatic_update_extensions_enabled and automatic_update_extension.automation_account_id properties Jan 5, 2023
@ziyeqf ziyeqf force-pushed the tengzh/issue/vault_auto_update branch from 4f8491a to d06c647 Compare January 5, 2023 02:30
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @ziyeqf, thanks for making those changes. I was looking more into this and it looks like we are changing the ProviderSpecificInput type from the basic type ReplicationProviderSpecificContainerMappingInput to A2A. I also see that there is another type called VMwareCbt.

I don't like that we're favoring one type over the other in this resource and we are making that decision for the user based off their input whilst also not letting them use the other type if they want.

Do you know if this resource does anything? It doesn't appear so since most of the functionality comes from what you're adding here. If this resource isn't doing anything, it's probably worth creating a new resource and deprecating this one. That new resource will be azurerm_site_recovery_protection_container_mapping_a2a. That will also give us the flexibility to add the other type azurerm_site_recovery_protection_container_mapping_vmware_cbt if there are asks for it.

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Jan 10, 2023

Hi @mbfrahry , For the current resources azurerm_site_recovery_xxx, they are all for A2A(Azure To Azure) type.

For Site Recovery, there are basically four type A2A,V2A(Vmware To Azure) Classic,V2A Modern and H2A(HyperV To Azure). I have worked to add the rest three types and I think the current resources are all for A2A so it should be ok to specify a input type. For the others I'm going to name them as azure_site_recovery_xxx_v2a_classic and so on..

How do you like that?

I have also thought about renaming the current a2a resources to azurerm_site_recovery_xxx_a2a, while it seems to be breaking...

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

That is fair. So with that being the case, we can nearly revert it back to the way you had it with those attributes being at the top level. But we should also force the type to be InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A as in the original PR submitted, the type was being changed back to ReplicationProviderSpecificContainerMappingInput if these new attributes weren't set.

Apologies for the run around on this!

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Jan 11, 2023

temporarily close this PR to reduce noise in refactoring.

@ziyeqf ziyeqf closed this Jan 11, 2023
@ziyeqf ziyeqf reopened this Jan 11, 2023
@katbyte
Copy link
Collaborator

katbyte commented Jan 12, 2023

@ziyeqf - is there any progress on getting this merged so we don't need the hack? Azure/azure-rest-api-specs#21652

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Jan 17, 2023

@ziyeqf - is there any progress on getting this merged so we don't need the hack? Azure/azure-rest-api-specs#21652

oh, it's a mistake, Tom has explained it's not a Pandora issue. While the codes on main branch has been changed. I'm wondering if we can specify the property type to A2A in the create function then we will not need the workaround.

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Jan 17, 2023

new test result

TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryProtectionContainerMapping -timeout=60m
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_basic
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_basic
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_basic
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_basic (841.12s)
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension (1290.34s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1291.507s

@ziyeqf
Copy link
Contributor Author

ziyeqf commented Jan 20, 2023

test result after rename

terraform-provider-azurerm ❯ TF_ACC=1 go test -v ./internal/services/recoveryservices -run=TestAccSiteRecoveryProtectionContainerMapping -timeout=60m
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_basic
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_basic
=== RUN   TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== PAUSE TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_basic
=== CONT  TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_basic (848.41s)
--- PASS: TestAccSiteRecoveryProtectionContainerMapping_withAutoUpdateExtension (1179.99s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/recoveryservices      1183.464s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @ziyeqf - LGTM 🛠️

@katbyte katbyte merged commit 918993a into hashicorp:main Jan 30, 2023
@github-actions github-actions bot added this to the v3.42.0 milestone Jan 30, 2023
katbyte added a commit that referenced this pull request Jan 30, 2023
@github-actions
Copy link

github-actions bot commented Feb 3, 2023

This functionality has been released in v3.42.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Mar 6, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants