You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
variable"name" {
description="(required) - The name of the resource, provided by the client when initially creating\nthe resource. The resource name must be 1-63 characters long, and comply\nwith RFC1035. Specifically, the name must be 1-63 characters long and\nmatch the regular expression '[a-z]([-a-z0-9]*[a-z0-9])'? which means the\nfirst character must be a lowercase letter, and all following characters\nmust be a dash, lowercase letter, or digit, except the last character,\nwhich cannot be a dash."type=string
}
variable"project" {
description="(optional)"type=stringdefault=null
}
variable"region" {
description="(optional) - Region where resource policy resides."type=stringdefault=null
}
variable"group_placement_policy" {
description="nested block: NestingList, min items: 0, max items: 1"type=set(object(
{
availability_domain_count =number
collocation =string
vm_count =number
}
))
default=[]
}
variable"snapshot_schedule_policy" {
description="nested block: NestingList, min items: 0, max items: 1"type=set(object(
{
retention_policy =list(object(
{
max_retention_days =number
on_source_disk_delete =string
}
))
schedule =list(object(
{
daily_schedule =list(object(
{
days_in_cycle =number
start_time =string
}
))
hourly_schedule =list(object(
{
hours_in_cycle =number
start_time =string
}
))
weekly_schedule =list(object(
{
day_of_weeks =set(object(
{
day =string
start_time =string
}
))
}
))
}
))
snapshot_properties =list(object(
{
guest_flush =bool
labels =map(string)
storage_locations =set(string)
}
))
}
))
default=[]
}
variable"timeouts" {
description="nested block: NestingSingle, min items: 0, max items: 0"type=set(object(
{
create =string
delete =string
}
))
default=[]
}
resource"google_compute_resource_policy""this" {
# name - (required) is a type of stringname=var.name# project - (optional) is a type of stringproject=var.project# region - (optional) is a type of stringregion=var.regiondynamic"group_placement_policy" {
for_each=var.group_placement_policycontent {
# availability_domain_count - (optional) is a type of numberavailability_domain_count=group_placement_policy.value["availability_domain_count"]
# collocation - (optional) is a type of stringcollocation=group_placement_policy.value["collocation"]
# vm_count - (optional) is a type of numbervm_count=group_placement_policy.value["vm_count"]
}
}
dynamic"snapshot_schedule_policy" {
for_each=var.snapshot_schedule_policycontent {
dynamic"retention_policy" {
for_each=snapshot_schedule_policy.value.retention_policycontent {
# max_retention_days - (required) is a type of numbermax_retention_days=retention_policy.value["max_retention_days"]
# on_source_disk_delete - (optional) is a type of stringon_source_disk_delete=retention_policy.value["on_source_disk_delete"]
}
}
dynamic"schedule" {
for_each=snapshot_schedule_policy.value.schedulecontent {
dynamic"daily_schedule" {
for_each=schedule.value.daily_schedulecontent {
# days_in_cycle - (required) is a type of numberdays_in_cycle=daily_schedule.value["days_in_cycle"]
# start_time - (required) is a type of stringstart_time=daily_schedule.value["start_time"]
}
}
dynamic"hourly_schedule" {
for_each=schedule.value.hourly_schedulecontent {
# hours_in_cycle - (required) is a type of numberhours_in_cycle=hourly_schedule.value["hours_in_cycle"]
# start_time - (required) is a type of stringstart_time=hourly_schedule.value["start_time"]
}
}
dynamic"weekly_schedule" {
for_each=schedule.value.weekly_schedulecontent {
dynamic"day_of_weeks" {
for_each=weekly_schedule.value.day_of_weekscontent {
# day - (required) is a type of stringday=day_of_weeks.value["day"]
# start_time - (required) is a type of stringstart_time=day_of_weeks.value["start_time"]
}
}
}
}
}
}
dynamic"snapshot_properties" {
for_each=snapshot_schedule_policy.value.snapshot_propertiescontent {
# guest_flush - (optional) is a type of boolguest_flush=snapshot_properties.value["guest_flush"]
# labels - (optional) is a type of map of stringlabels=snapshot_properties.value["labels"]
# storage_locations - (optional) is a type of set of stringstorage_locations=snapshot_properties.value["storage_locations"]
}
}
}
}
dynamic"timeouts" {
for_each=var.timeoutscontent {
# create - (optional) is a type of stringcreate=timeouts.value["create"]
# delete - (optional) is a type of stringdelete=timeouts.value["delete"]
}
}
}