Terraform-provider-azurerm: Feature request: support AzureVmWorkloadProtectionPolicy in RecoveryServicesVault

Created on 9 Aug 2019  路  8Comments  路  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Right now the Recovery Services resources only allow creating ProtectionPolicies and ProtectedItems for AzureVMs, but not for the other types of resources.

It would be nice to have the option for AzureVmWorkloadProtectionPolicy and AzureVmWorkloadProtectedItem in order to backup SQL VMs with the managed service.

New or Affected Resource(s)

  • azurerm_recovery_services_protection_policy_sql_vm
  • azurerm_recovery_services_protected_sql_vm

Potential Terraform Configuration

I think defining the resource abstractions requires a little more experience than what I have, but here's the Python definition I used for the Policy's model, which could help a little to move it to Go. The SDK model names are the same so it should be easy to map them.

protection_policy = AzureVmWorkloadProtectionPolicy(
        backup_management_type='AzureWorkload',
        work_load_type="SQLDataBase",
        settings=Settings(
            issqlcompression=False,
            is_compression=False
        ),
        sub_protection_policy=[
            SubProtectionPolicy(
                policy_type="Full",  # PolicyType.full
                retention_policy=LongTermRetentionPolicy(
                    retention_policy_type="LongTermRetentionPolicy",
                    daily_schedule=DailyRetentionSchedule(
                        retention_times=[
                            datetime(2019, 8, 9, 5, 0, 0)],
                        retention_duration=RetentionDuration(
                            count=180,
                            duration_type=RetentionDurationType.days
                        )
                    )
                ),
                schedule_policy=SimpleSchedulePolicy(
                    schedule_policy_type="SimpleSchedulePolicy",
                    schedule_run_days=None,
                    schedule_run_frequency=ScheduleRunType.daily,
                    schedule_run_times=[
                        datetime(2019, 8, 9, 5, 0, 0)],
                    schedule_weekly_frequency=0
                )
            ),
            SubProtectionPolicy(
                policy_type="Log",
                retention_policy=SimpleRetentionPolicy(
                    retention_policy_type="SimpleRetentionPolicy",
                    retention_duration=RetentionDuration(
                        count=15,
                        duration_type=RetentionDurationType.days
                    )
                ),
                schedule_policy=LogSchedulePolicy(
                    schedule_policy_type="LogSchedulePolicy",
                    schedule_frequency_in_mins=15
                )
            )
        ]
    )

### References
https://www.terraform.io/docs/providers/azurerm/r/recovery_services_protection_policy_vm.html
https://www.terraform.io/docs/providers/azurerm/r/recovery_services_protected_vm.html
enhancement servicrecovery-services

Most helpful comment

Hi @AndresPineros can you please update your submission to use the template found here please: https://github.com/terraform-providers/terraform-provider-azurerm/issues/new?template=Feature_Request.md

All 8 comments

+1

having the same issue

Having the same issue

I'm having the same issue. Currently i'm making this manually but this action mess up the terraform state.

Hi @AndresPineros can you please update your submission to use the template found here please: https://github.com/terraform-providers/terraform-provider-azurerm/issues/new?template=Feature_Request.md

Implementation of the Workload Types SAPHANA and SapHanaDatabase would be very much appreciated.

+1

Looking forward to this one too.

+1
We need this as well.

Was this page helpful?
0 / 5 - 0 ratings