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"description" {
description="(optional) - An optional description of this resource."type=stringdefault=null
}
variable"name" {
description="(required) - Name of the resource. The name must be 1-63 characters long and match\nthe regular expression '[a-z]([-a-z0-9]*[a-z0-9])?' which means the\nfirst character must be a lowercase letter, and all following\ncharacters must be a dash, lowercase letter, or digit, except the last\ncharacter, which cannot be a dash."type=string
}
variable"project" {
description="(optional)"type=stringdefault=null
}
variable"region" {
description="(optional) - URL of the region where the instance group resides."type=stringdefault=null
}
variable"target" {
description="(required) - URL of the managed instance group that this autoscaler will scale."type=string
}
variable"autoscaling_policy" {
description="nested block: NestingList, min items: 1, max items: 1"type=set(object(
{
cooldown_period =number
cpu_utilization =list(object(
{
predictive_method =string
target =number
}
))
load_balancing_utilization =list(object(
{
target =number
}
))
max_replicas =number
metric =list(object(
{
filter =string
name =string
single_instance_assignment =number
target =number
type =string
}
))
min_replicas =number
mode =string
scale_down_control =list(object(
{
max_scaled_down_replicas =list(object(
{
fixed =number
percent =number
}
))
time_window_sec =number
}
))
scale_in_control =list(object(
{
max_scaled_in_replicas =list(object(
{
fixed =number
percent =number
}
))
time_window_sec =number
}
))
scaling_schedules =set(object(
{
description =string
disabled =bool
duration_sec =number
min_required_replicas =number
name =string
schedule =string
time_zone =string
}
))
}
))
}
variable"timeouts" {
description="nested block: NestingSingle, min items: 0, max items: 0"type=set(object(
{
create =string
delete =string
update =string
}
))
default=[]
}
resource"google_compute_region_autoscaler""this" {
# description - (optional) is a type of stringdescription=var.description# 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.region# target - (required) is a type of stringtarget=var.targetdynamic"autoscaling_policy" {
for_each=var.autoscaling_policycontent {
# cooldown_period - (optional) is a type of numbercooldown_period=autoscaling_policy.value["cooldown_period"]
# max_replicas - (required) is a type of numbermax_replicas=autoscaling_policy.value["max_replicas"]
# min_replicas - (required) is a type of numbermin_replicas=autoscaling_policy.value["min_replicas"]
# mode - (optional) is a type of stringmode=autoscaling_policy.value["mode"]
dynamic"cpu_utilization" {
for_each=autoscaling_policy.value.cpu_utilizationcontent {
# predictive_method - (optional) is a type of stringpredictive_method=cpu_utilization.value["predictive_method"]
# target - (required) is a type of numbertarget=cpu_utilization.value["target"]
}
}
dynamic"load_balancing_utilization" {
for_each=autoscaling_policy.value.load_balancing_utilizationcontent {
# target - (required) is a type of numbertarget=load_balancing_utilization.value["target"]
}
}
dynamic"metric" {
for_each=autoscaling_policy.value.metriccontent {
# filter - (optional) is a type of stringfilter=metric.value["filter"]
# name - (required) is a type of stringname=metric.value["name"]
# single_instance_assignment - (optional) is a type of numbersingle_instance_assignment=metric.value["single_instance_assignment"]
# target - (optional) is a type of numbertarget=metric.value["target"]
# type - (optional) is a type of stringtype=metric.value["type"]
}
}
dynamic"scale_down_control" {
for_each=autoscaling_policy.value.scale_down_controlcontent {
# time_window_sec - (optional) is a type of numbertime_window_sec=scale_down_control.value["time_window_sec"]
dynamic"max_scaled_down_replicas" {
for_each=scale_down_control.value.max_scaled_down_replicascontent {
# fixed - (optional) is a type of numberfixed=max_scaled_down_replicas.value["fixed"]
# percent - (optional) is a type of numberpercent=max_scaled_down_replicas.value["percent"]
}
}
}
}
dynamic"scale_in_control" {
for_each=autoscaling_policy.value.scale_in_controlcontent {
# time_window_sec - (optional) is a type of numbertime_window_sec=scale_in_control.value["time_window_sec"]
dynamic"max_scaled_in_replicas" {
for_each=scale_in_control.value.max_scaled_in_replicascontent {
# fixed - (optional) is a type of numberfixed=max_scaled_in_replicas.value["fixed"]
# percent - (optional) is a type of numberpercent=max_scaled_in_replicas.value["percent"]
}
}
}
}
dynamic"scaling_schedules" {
for_each=autoscaling_policy.value.scaling_schedulescontent {
# description - (optional) is a type of stringdescription=scaling_schedules.value["description"]
# disabled - (optional) is a type of booldisabled=scaling_schedules.value["disabled"]
# duration_sec - (required) is a type of numberduration_sec=scaling_schedules.value["duration_sec"]
# min_required_replicas - (required) is a type of numbermin_required_replicas=scaling_schedules.value["min_required_replicas"]
# name - (required) is a type of stringname=scaling_schedules.value["name"]
# schedule - (required) is a type of stringschedule=scaling_schedules.value["schedule"]
# time_zone - (optional) is a type of stringtime_zone=scaling_schedules.value["time_zone"]
}
}
}
}
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"]
# update - (optional) is a type of stringupdate=timeouts.value["update"]
}
}
}