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.
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
+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.
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