I have tried all possible ways, snapshot scheduler only works from console.
it does not work through API using terraform 11
here is the code used create schedule after that it won’t create a snapshot after scheduling
Please, can you check or give a try.
resource “google_compute_resource_policy” “snapshot” {
name = “policy”
project = “MYPROJECT”
region = “europe-west2”
snapshot_schedule_policy {
schedule {
daily_schedule{
days_in_cycle = 1
start_time = “20:00”
}
}
retention_policy {
max_retention_days = 1
on_source_disk_delete = “KEEP_AUTO_SNAPSHOTS”
}
snapshot_properties {
/labels = {
my_label = “value”
}/
storage_locations = ["europe-west2"]
guest_flush = false
}
}
}
resource “google_compute_disk_resource_policy_attachment” “policyattach1” {
project = “MYPROJECT”
zone = “europe-west2-a”
name = “policy”
disk = “disk-2”
}
Ref - https://www.terraform.io/docs/providers/google/r/compute_resource_policy.html#start_time-1
https://www.terraform.io/docs/providers/google/r/compute_disk_resource_policy_attachment.html
Thanks