terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

new resources `azurerm_netapp_backup_vault` and `azurerm_netapp_backup_policy`

Open paulomarquesc opened this issue 6 months ago • 2 comments

Community Note

  • Please vote on this PR by adding a :thumbsup: reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This PR consists of:

  • Implementation of ANF Backup Policy Support with two new resources: netapp_backup_vault and netapp_backup_policy
  • Implementation of a new netapp feature configuration block focused on safety as follows:
    • prevent_volume_destruction - Set to true by default, prevents a very common occurrence for Azure NetApp customers losing data due to volume destruction. This will change current behavior of volume destruction, and they will fail destruction if not set but this is required to be set now since we have many Azure customers (for various reasons) losing their volumes and for Azure NetApp Files, this is a non-recoverable disaster.
    • delete_backups_on_backup_vault_destroy - Set to false by default, this will protect customers from having their backups destroyed, making sure customers can restore their data.
  • prevent_volume_destruction was added and set to false to all acceptance tests that requires volume resource to allow it to clean up the test and complete it successfully
  • APIs bumped up to 2024-03-01
  • Bugfixes for snapshot_directory_visible volume configuration preventing acceptance tests for CRR to complete

PR Checklist

  • [X] I have followed the guidelines in our Contributing Documentation.
  • [X] I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • [X] I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • [X] I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • [X] I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work. For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • [X] I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • [X] I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • [X] I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • [ ] (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • [X] My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/netapp -parallel 1 -run=TestAccNetApp -skip=TestAccNetAppVolumeGroupSapHana -count=1 -timeout 1200m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccNetAppAccountEncryptionDataSource_basic
=== PAUSE TestAccNetAppAccountEncryptionDataSource_basic
=== RUN   TestAccNetAppAccountEncryption_cmkSystemAssigned
=== PAUSE TestAccNetAppAccountEncryption_cmkSystemAssigned
=== RUN   TestAccNetAppAccountEncryption_cmkUserAssigned
=== PAUSE TestAccNetAppAccountEncryption_cmkUserAssigned
=== RUN   TestAccNetAppAccountEncryption_updateKey
=== PAUSE TestAccNetAppAccountEncryption_updateKey
=== RUN   TestAccNetAppAccountResource
=== RUN   TestAccNetAppAccountResource/Resource
=== RUN   TestAccNetAppAccountResource/Resource/basic
=== PAUSE TestAccNetAppAccountResource/Resource/basic
=== CONT  TestAccNetAppAccountResource/Resource/basic
=== RUN   TestAccNetAppAccountResource/Resource#01
=== RUN   TestAccNetAppAccountResource/Resource#01/requiresImport
=== PAUSE TestAccNetAppAccountResource/Resource#01/requiresImport
=== CONT  TestAccNetAppAccountResource/Resource#01/requiresImport
=== RUN   TestAccNetAppAccountResource/Resource#02
=== RUN   TestAccNetAppAccountResource/Resource#02/complete
=== PAUSE TestAccNetAppAccountResource/Resource#02/complete
=== CONT  TestAccNetAppAccountResource/Resource#02/complete
=== RUN   TestAccNetAppAccountResource/Resource#03
=== RUN   TestAccNetAppAccountResource/Resource#03/update
=== PAUSE TestAccNetAppAccountResource/Resource#03/update
=== CONT  TestAccNetAppAccountResource/Resource#03/update
--- PASS: TestAccNetAppAccountResource (451.08s)
    --- PASS: TestAccNetAppAccountResource/Resource (0.00s)
        --- PASS: TestAccNetAppAccountResource/Resource/basic (80.75s)
    --- PASS: TestAccNetAppAccountResource/Resource#01 (0.00s)
        --- PASS: TestAccNetAppAccountResource/Resource#01/requiresImport (74.43s)
    --- PASS: TestAccNetAppAccountResource/Resource#02 (0.00s)
        --- PASS: TestAccNetAppAccountResource/Resource#02/complete (132.21s)
    --- PASS: TestAccNetAppAccountResource/Resource#03 (0.00s)
        --- PASS: TestAccNetAppAccountResource/Resource#03/update (163.68s)
=== RUN   TestAccNetAppAccount_systemAssignedManagedIdentity
=== PAUSE TestAccNetAppAccount_systemAssignedManagedIdentity
=== RUN   TestAccNetAppAccount_userAssignedManagedIdentity
=== PAUSE TestAccNetAppAccount_userAssignedManagedIdentity
=== RUN   TestAccNetAppAccount_updateManagedIdentity
=== PAUSE TestAccNetAppAccount_updateManagedIdentity
=== RUN   TestAccNetAppBackupPolicyDataSource_basic
=== PAUSE TestAccNetAppBackupPolicyDataSource_basic
=== RUN   TestAccNetAppBackupPolicy_basic
=== PAUSE TestAccNetAppBackupPolicy_basic
=== RUN   TestAccNetAppBackupPolicy_update
=== PAUSE TestAccNetAppBackupPolicy_update
=== RUN   TestAccNetAppBackupVaultDataSource_basic
=== PAUSE TestAccNetAppBackupVaultDataSource_basic
=== RUN   TestAccNetAppBackupVault_basic
=== PAUSE TestAccNetAppBackupVault_basic
=== RUN   TestAccNetAppBackupVault_update
=== PAUSE TestAccNetAppBackupVault_update
=== RUN   TestAccNetAppPool_basic
=== PAUSE TestAccNetAppPool_basic
=== RUN   TestAccNetAppPool_requiresImport
=== PAUSE TestAccNetAppPool_requiresImport
=== RUN   TestAccNetAppPool_complete
=== PAUSE TestAccNetAppPool_complete
=== RUN   TestAccNetAppPool_update
=== PAUSE TestAccNetAppPool_update
=== RUN   TestAccNetAppPool_doubleEncryption
=== PAUSE TestAccNetAppPool_doubleEncryption
=== RUN   TestAccNetAppSnapshotPolicy_basic
=== PAUSE TestAccNetAppSnapshotPolicy_basic
=== RUN   TestAccNetAppSnapshotPolicy_hourlySchedule
=== PAUSE TestAccNetAppSnapshotPolicy_hourlySchedule
=== RUN   TestAccNetAppSnapshotPolicy_dailySchedule
=== PAUSE TestAccNetAppSnapshotPolicy_dailySchedule
=== RUN   TestAccNetAppSnapshotPolicy_weeklySchedule
=== PAUSE TestAccNetAppSnapshotPolicy_weeklySchedule
=== RUN   TestAccNetAppSnapshotPolicy_monthlySchedule
=== PAUSE TestAccNetAppSnapshotPolicy_monthlySchedule
=== RUN   TestAccNetAppSnapshotPolicy_requiresImport
=== PAUSE TestAccNetAppSnapshotPolicy_requiresImport
=== RUN   TestAccNetAppSnapshotPolicy_updateSnapshotPolicy
=== PAUSE TestAccNetAppSnapshotPolicy_updateSnapshotPolicy
=== RUN   TestAccNetAppSnapshotPolicy_complete
=== PAUSE TestAccNetAppSnapshotPolicy_complete
=== RUN   TestAccNetAppSnapshot_basic
=== PAUSE TestAccNetAppSnapshot_basic
=== RUN   TestAccNetAppSnapshot_requiresImport
=== PAUSE TestAccNetAppSnapshot_requiresImport
=== RUN   TestAccNetAppSnapshot_complete
=== PAUSE TestAccNetAppSnapshot_complete
=== RUN   TestAccNetAppVolumeQuotaRuleDataSource_basic
=== PAUSE TestAccNetAppVolumeQuotaRuleDataSource_basic
=== RUN   TestAccNetAppVolumeQuotaRule_individualGroupQuotaType
=== PAUSE TestAccNetAppVolumeQuotaRule_individualGroupQuotaType
=== RUN   TestAccNetAppVolumeQuotaRule_individualUserQuotaType
=== PAUSE TestAccNetAppVolumeQuotaRule_individualUserQuotaType
=== RUN   TestAccNetAppVolumeQuotaRule_defaultGroupQuotaType
=== PAUSE TestAccNetAppVolumeQuotaRule_defaultGroupQuotaType
=== RUN   TestAccNetAppVolumeQuotaRule_defaultUserQuotaType
=== PAUSE TestAccNetAppVolumeQuotaRule_defaultUserQuotaType
=== RUN   TestAccNetAppVolume_basic
=== PAUSE TestAccNetAppVolume_basic
=== RUN   TestAccNetAppVolume_backupPolicy
=== PAUSE TestAccNetAppVolume_backupPolicy
=== RUN   TestAccNetAppVolume_availabilityZone
=== PAUSE TestAccNetAppVolume_availabilityZone
=== RUN   TestAccNetAppVolume_nfsv41
=== PAUSE TestAccNetAppVolume_nfsv41
=== RUN   TestAccNetAppVolume_standardNetworkFeature
=== PAUSE TestAccNetAppVolume_standardNetworkFeature
=== RUN   TestAccNetAppVolume_snapshotPolicy
=== PAUSE TestAccNetAppVolume_snapshotPolicy
=== RUN   TestAccNetAppVolume_crossRegionReplication
=== PAUSE TestAccNetAppVolume_crossRegionReplication
=== RUN   TestAccNetAppVolume_nfsv3FromSnapshot
=== PAUSE TestAccNetAppVolume_nfsv3FromSnapshot
=== RUN   TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleFalse
=== PAUSE TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleFalse
=== RUN   TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleTrue
=== PAUSE TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleTrue
=== RUN   TestAccNetAppVolume_requiresImport
=== PAUSE TestAccNetAppVolume_requiresImport
=== RUN   TestAccNetAppVolume_complete
=== PAUSE TestAccNetAppVolume_complete
=== RUN   TestAccNetAppVolume_update
=== PAUSE TestAccNetAppVolume_update
=== RUN   TestAccNetAppVolume_updateSubnet
=== PAUSE TestAccNetAppVolume_updateSubnet
=== RUN   TestAccNetAppVolume_updateExportPolicyRule
=== PAUSE TestAccNetAppVolume_updateExportPolicyRule
=== RUN   TestAccNetAppVolume_volEncryptionCmkUserAssigned
=== PAUSE TestAccNetAppVolume_volEncryptionCmkUserAssigned
=== RUN   TestAccNetAppVolume_volEncryptionCmkSystemAssigned
=== PAUSE TestAccNetAppVolume_volEncryptionCmkSystemAssigned
=== CONT  TestAccNetAppAccountEncryptionDataSource_basic
--- PASS: TestAccNetAppAccountEncryptionDataSource_basic (299.44s)
=== CONT  TestAccNetAppVolume_complete
--- PASS: TestAccNetAppVolume_complete (781.28s)
=== CONT  TestAccNetAppVolume_volEncryptionCmkSystemAssigned
--- PASS: TestAccNetAppVolume_volEncryptionCmkSystemAssigned (938.69s)
=== CONT  TestAccNetAppVolume_volEncryptionCmkUserAssigned
--- PASS: TestAccNetAppVolume_volEncryptionCmkUserAssigned (983.19s)
=== CONT  TestAccNetAppVolume_updateExportPolicyRule
--- PASS: TestAccNetAppVolume_updateExportPolicyRule (852.24s)
=== CONT  TestAccNetAppVolume_updateSubnet
--- PASS: TestAccNetAppVolume_updateSubnet (1343.69s)
=== CONT  TestAccNetAppVolume_update
--- PASS: TestAccNetAppVolume_update (808.37s)
=== CONT  TestAccNetAppSnapshotPolicy_requiresImport
--- PASS: TestAccNetAppSnapshotPolicy_requiresImport (320.13s)
=== CONT  TestAccNetAppVolume_requiresImport
--- PASS: TestAccNetAppVolume_requiresImport (735.75s)
=== CONT  TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleTrue
--- PASS: TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleTrue (949.45s)
=== CONT  TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleFalse
--- PASS: TestAccNetAppVolume_nfsv3SnapshotDirectoryVisibleFalse (727.86s)
=== CONT  TestAccNetAppVolume_nfsv3FromSnapshot
--- PASS: TestAccNetAppVolume_nfsv3FromSnapshot (967.56s)
=== CONT  TestAccNetAppVolume_crossRegionReplication
--- PASS: TestAccNetAppVolume_crossRegionReplication (1636.44s)
=== CONT  TestAccNetAppVolume_snapshotPolicy
--- PASS: TestAccNetAppVolume_snapshotPolicy (807.05s)
=== CONT  TestAccNetAppVolume_standardNetworkFeature
--- PASS: TestAccNetAppVolume_standardNetworkFeature (790.36s)
=== CONT  TestAccNetAppVolume_nfsv41
--- PASS: TestAccNetAppVolume_nfsv41 (802.52s)
=== CONT  TestAccNetAppVolume_availabilityZone
--- PASS: TestAccNetAppVolume_availabilityZone (717.26s)
=== CONT  TestAccNetAppVolume_backupPolicy
--- PASS: TestAccNetAppVolume_backupPolicy (1054.74s)
=== CONT  TestAccNetAppVolume_basic
--- PASS: TestAccNetAppVolume_basic (752.55s)
=== CONT  TestAccNetAppVolumeQuotaRule_defaultUserQuotaType
--- PASS: TestAccNetAppVolumeQuotaRule_defaultUserQuotaType (750.07s)
=== CONT  TestAccNetAppVolumeQuotaRule_defaultGroupQuotaType
--- PASS: TestAccNetAppVolumeQuotaRule_defaultGroupQuotaType (728.69s)
=== CONT  TestAccNetAppVolumeQuotaRule_individualUserQuotaType
--- PASS: TestAccNetAppVolumeQuotaRule_individualUserQuotaType (730.55s)
=== CONT  TestAccNetAppVolumeQuotaRule_individualGroupQuotaType
--- PASS: TestAccNetAppVolumeQuotaRule_individualGroupQuotaType (732.31s)
=== CONT  TestAccNetAppVolumeQuotaRuleDataSource_basic
--- PASS: TestAccNetAppVolumeQuotaRuleDataSource_basic (736.75s)
=== CONT  TestAccNetAppSnapshot_complete
--- PASS: TestAccNetAppSnapshot_complete (752.03s)
=== CONT  TestAccNetAppSnapshot_requiresImport
--- PASS: TestAccNetAppSnapshot_requiresImport (855.91s)
=== CONT  TestAccNetAppSnapshot_basic
--- PASS: TestAccNetAppSnapshot_basic (774.35s)
=== CONT  TestAccNetAppSnapshotPolicy_complete
--- PASS: TestAccNetAppSnapshotPolicy_complete (296.06s)
=== CONT  TestAccNetAppSnapshotPolicy_updateSnapshotPolicy
--- PASS: TestAccNetAppSnapshotPolicy_updateSnapshotPolicy (310.56s)
=== CONT  TestAccNetAppBackupVault_update
--- PASS: TestAccNetAppBackupVault_update (195.70s)
=== CONT  TestAccNetAppSnapshotPolicy_monthlySchedule
--- PASS: TestAccNetAppSnapshotPolicy_monthlySchedule (339.56s)
=== CONT  TestAccNetAppSnapshotPolicy_weeklySchedule
--- PASS: TestAccNetAppSnapshotPolicy_weeklySchedule (260.96s)
=== CONT  TestAccNetAppSnapshotPolicy_dailySchedule
--- PASS: TestAccNetAppSnapshotPolicy_dailySchedule (267.62s)
=== CONT  TestAccNetAppSnapshotPolicy_hourlySchedule
--- PASS: TestAccNetAppSnapshotPolicy_hourlySchedule (266.05s)
=== CONT  TestAccNetAppSnapshotPolicy_basic
--- PASS: TestAccNetAppSnapshotPolicy_basic (300.94s)
=== CONT  TestAccNetAppPool_doubleEncryption
--- PASS: TestAccNetAppPool_doubleEncryption (229.32s)
=== CONT  TestAccNetAppPool_update
--- PASS: TestAccNetAppPool_update (400.63s)
=== CONT  TestAccNetAppPool_complete
--- PASS: TestAccNetAppPool_complete (228.59s)
=== CONT  TestAccNetAppPool_requiresImport
--- PASS: TestAccNetAppPool_requiresImport (231.55s)
=== CONT  TestAccNetAppPool_basic
--- PASS: TestAccNetAppPool_basic (229.07s)
=== CONT  TestAccNetAppAccount_updateManagedIdentity
--- PASS: TestAccNetAppAccount_updateManagedIdentity (110.28s)
=== CONT  TestAccNetAppBackupVault_basic
--- PASS: TestAccNetAppBackupVault_basic (196.14s)
=== CONT  TestAccNetAppBackupVaultDataSource_basic
--- PASS: TestAccNetAppBackupVaultDataSource_basic (143.25s)
=== CONT  TestAccNetAppBackupPolicy_update
--- PASS: TestAccNetAppBackupPolicy_update (229.09s)
=== CONT  TestAccNetAppBackupPolicy_basic
--- PASS: TestAccNetAppBackupPolicy_basic (144.87s)
=== CONT  TestAccNetAppBackupPolicyDataSource_basic
--- PASS: TestAccNetAppBackupPolicyDataSource_basic (142.34s)
=== CONT  TestAccNetAppAccountEncryption_updateKey
--- PASS: TestAccNetAppAccountEncryption_updateKey (385.23s)
=== CONT  TestAccNetAppAccount_userAssignedManagedIdentity
--- PASS: TestAccNetAppAccount_userAssignedManagedIdentity (77.22s)
=== CONT  TestAccNetAppAccount_systemAssignedManagedIdentity
--- PASS: TestAccNetAppAccount_systemAssignedManagedIdentity (71.73s)
=== CONT  TestAccNetAppAccountEncryption_cmkUserAssigned
--- PASS: TestAccNetAppAccountEncryption_cmkUserAssigned (250.13s)
=== CONT  TestAccNetAppAccountEncryption_cmkSystemAssigned
--- PASS: TestAccNetAppAccountEncryption_cmkSystemAssigned (305.16s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp        28392.397s

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_netapp_backup_vault - add support for backup vaults that are the parents of backups and it is associated with a volume.
  • azurerm_netapp_backup_policy - a backup policy to assign to a volume that indicates that volume will start to have internally scheduled backups and what is the retention policy.

This is a (please select all that apply):

  • [X] Bug Fix
  • [X] New Feature (ie adding a service, resource, or data source)
  • [ ] Enhancement
  • [ ] Breaking Change

Related Issue(s)

Fixes #16242

paulomarquesc avatar Aug 24 '24 14:08 paulomarquesc