-
Notifications
You must be signed in to change notification settings - Fork 4
/
instance_autoscaling.tf
95 lines (87 loc) · 2.69 KB
/
instance_autoscaling.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
resource "oci_autoscaling_auto_scaling_configuration" "FoggyKitchenThresholdAutoScalingConfiguration" {
auto_scaling_resources {
id = oci_core_instance_pool.FoggyKitchenInstancePool.id
type = "instancePool"
}
compartment_id = oci_identity_compartment.FoggyKitchenCompartment.id
policies {
display_name = "FoggyKitchenThresholdAutoScalingConfigurationPolicies"
capacity {
initial = "2"
max = "4"
min = "2"
}
policy_type = "threshold"
rules {
action {
type = "CHANGE_COUNT_BY"
value = "1"
}
display_name = "FoggyKitchenThresholdAutoScalingConfigurationPoliciesScaleOutRule"
metric {
metric_type = "CPU_UTILIZATION"
threshold {
operator = "GT"
value = "80"
}
}
}
rules {
action {
type = "CHANGE_COUNT_BY"
value = "-1"
}
display_name = "FoggyKitchenThresholdAutoScalingConfigurationPoliciesScaleInRule"
metric {
metric_type = "CPU_UTILIZATION"
threshold {
operator = "LT"
value = "20"
}
}
}
}
cool_down_in_seconds = "300"
display_name = "FoggyKitchenThresholdAutoScalingConfiguration"
}
/*
resource "oci_autoscaling_auto_scaling_configuration" "FoggyKitchenScheduledAutoScalingConfiguration" {
auto_scaling_resources {
id = oci_core_instance_pool.FoggyKitchenInstancePool.id
type = "instancePool"
}
compartment_id = oci_identity_compartment.FoggyKitchenCompartment.id
policies {
display_name = "FoggyKitchenScheduledAutoScalingConfigurationScaleOutPolicy"
capacity {
initial = "4"
max = "4"
min = "2"
}
policy_type = "scheduled"
execution_schedule {
# 12:00, 28/09/2020
expression = "0 0 12 28 9 ? 2020"
timezone = "UTC"
type = "cron"
}
}
policies {
display_name = "FoggyKitchenScheduledAutoScalingConfigurationScaleInPolicy"
capacity {
initial = "2"
max = "2"
min = "2"
}
policy_type = "scheduled"
execution_schedule {
# 12:15, 28/09/2020
expression = "0 15 12 28 9 ? 2020"
timezone = "UTC"
type = "cron"
}
}
cool_down_in_seconds = "300"
display_name = "FoggyKitchenScheduledAutoScalingConfiguration"
}
*/