|
| 1 | +--- |
| 2 | +subcategory: "Cloud Container Instance (CCI)" |
| 3 | +layout: "huaweicloud" |
| 4 | +page_title: "HuaweiCloud: huaweicloud_cciv2_horizontal_pod_autoscaler" |
| 5 | +description: |- |
| 6 | + Manages a CCI v2 Horizontal Pod Autoscaler resource within HuaweiCloud. |
| 7 | +--- |
| 8 | + |
| 9 | +# huaweicloud_cciv2_horizontal_pod_autoscaler |
| 10 | + |
| 11 | +Manages a CCI v2 Horizontal Pod Autoscaler resource within HuaweiCloud. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +<!-- please add the usage of huaweicloud_cciv2_horizontal_pod_autoscaler --> |
| 16 | +```hcl |
| 17 | +
|
| 18 | +``` |
| 19 | + |
| 20 | +## Argument Reference |
| 21 | + |
| 22 | +The following arguments are supported: |
| 23 | + |
| 24 | +* `region` - (Optional, String, ForceNew) Specifies the region in which to create the resource. |
| 25 | + If omitted, the provider-level region will be used. |
| 26 | + Changing this creates a new resource. |
| 27 | + |
| 28 | +* `name` - (Required, String) Specifies the name of the CCI Image Snapshot. |
| 29 | + |
| 30 | +* `namespace` - (Required, String) Specifies the namespace. |
| 31 | + |
| 32 | +* `annotations` - (Optional, Map) Specifies the annotations of the CCI Image Snapshot. |
| 33 | + |
| 34 | +* `behavior` - (Optional, List) Specifies the behavior of the CCI horizontal pod autoscaler. |
| 35 | + The [behavior](#block--behavior) structure is documented below. |
| 36 | + |
| 37 | +* `labels` - (Optional, Map) Specifies the annotations of the CCI Image Snapshot. |
| 38 | + |
| 39 | +* `max_replicas` - (Optional, Int) Specifies the upper limit for the number of replicas |
| 40 | + to which the autoscaler can scale up. |
| 41 | + |
| 42 | +* `metrics` - (Optional, List) Specifies the metrics that can be used to calculate the desired replica count. |
| 43 | + The [metrics](#block--metrics) structure is documented below. |
| 44 | + |
| 45 | +* `min_replicas` - (Optional, Int) Specifies the lower limit for the number of replicas |
| 46 | + to which the autoscaler can scale down. |
| 47 | + |
| 48 | +* `scale_target_ref` - (Optional, List) Specifies the scale target. |
| 49 | + The [scale_target_ref](#block--scale_target_ref) structure is documented below. |
| 50 | + |
| 51 | +<a name="block--behavior"></a> |
| 52 | +The `behavior` block supports: |
| 53 | + |
| 54 | +* `scale_down` - (Optional, List) Specifies the scale down of the behavior. |
| 55 | + The [scale_down](#block--behavior--scale_down) structure is documented below. |
| 56 | + |
| 57 | +* `scale_up` - (Optional, List) Specifies the scale up of the behavior. |
| 58 | + The [scale_up](#block--behavior--scale_up) structure is documented below. |
| 59 | + |
| 60 | +<a name="block--behavior--scale_down"></a> |
| 61 | +The `scale_down` block supports: |
| 62 | + |
| 63 | +* `policies` - (Optional, List) Specifies the potential scaling policies which can be used during scaling. |
| 64 | + The [policies](#block--behavior--scale_down--policies) structure is documented below. |
| 65 | + |
| 66 | +* `select_policy` - (Optional, String) Specifies select policy that should be used. |
| 67 | + |
| 68 | +* `stabilization_window_seconds` - (Optional, Int) Specifies the seconds for which past recommendations should |
| 69 | + be considered while scaling up or scaling down. |
| 70 | + |
| 71 | +<a name="block--behavior--scale_down--policies"></a> |
| 72 | +The `policies` block supports: |
| 73 | + |
| 74 | +* `period_seconds` - (Optional, Int) Specifies the window of time for which the policy should hold true. |
| 75 | + |
| 76 | +* `type` - (Optional, String) Specifies the type of the scaling policy. |
| 77 | + |
| 78 | +* `value` - (Optional, Int) Specifies the value, it contains the amount of change which is permitted by the policy. |
| 79 | + |
| 80 | +<a name="block--behavior--scale_up"></a> |
| 81 | +The `scale_up` block supports: |
| 82 | + |
| 83 | +* `policies` - (Optional, List) Specifies the potential scaling policies which can be used during scaling. |
| 84 | + The [policies](#block--behavior--scale_up--policies) structure is documented below. |
| 85 | + |
| 86 | +* `select_policy` - (Optional, String) Specifies select policy that should be used. |
| 87 | + |
| 88 | +* `stabilization_window_seconds` - (Optional, Int) Specifies the seconds for which past recommendations should |
| 89 | + be considered while scaling up or scaling down. |
| 90 | + |
| 91 | +<a name="block--behavior--scale_up--policies"></a> |
| 92 | +The `policies` block supports: |
| 93 | + |
| 94 | +* `period_seconds` - (Optional, Int) Specifies the window of time for which the policy should hold true. |
| 95 | + |
| 96 | +* `type` - (Optional, String) Specifies the type of the scaling policy. |
| 97 | + |
| 98 | +* `value` - (Optional, Int) Specifies the value, it contains the amount of change which is permitted by the policy. |
| 99 | + |
| 100 | +<a name="block--metrics"></a> |
| 101 | +The `metrics` block supports: |
| 102 | + |
| 103 | +* `container_resource` - (Optional, List) Specifies the container resource metric source. |
| 104 | + The [container_resource](#block--metrics--container_resource) structure is documented below. |
| 105 | + |
| 106 | +* `external` - (Optional, List) Specifies the external metric resource. |
| 107 | + The [external](#block--metrics--external) structure is documented below. |
| 108 | + |
| 109 | +* `object` - (Optional, List) Specifies the object metric resource. |
| 110 | + The [object](#block--metrics--object) structure is documented below. |
| 111 | + |
| 112 | +* `pods` - (Optional, List) Specifies the pod metric resource. |
| 113 | + The [pods](#block--metrics--pods) structure is documented below. |
| 114 | + |
| 115 | +* `resource` - (Optional, List) Specifies the resource metric resource. |
| 116 | + The [resource](#block--metrics--resource) structure is documented below. |
| 117 | + |
| 118 | +* `type` - (Optional, String) Specifies the seconds for which past recommendations should |
| 119 | + be considered while scaling up or scaling down. |
| 120 | + |
| 121 | +<a name="block--metrics--container_resource"></a> |
| 122 | +The `container_resource` block supports: |
| 123 | + |
| 124 | +* `container` - (Optional, String) Specifies the name of the container in the pods of the scaling target. |
| 125 | + |
| 126 | +* `name` - (Optional, String) Specifies the name of the resource in question. |
| 127 | + |
| 128 | +* `target` - (Optional, List) Specifies the container resource metric source. |
| 129 | + The [target](#block--metrics--container_resource--target) structure is documented below. |
| 130 | + |
| 131 | +<a name="block--metrics--container_resource--target"></a> |
| 132 | +The `target` block supports: |
| 133 | + |
| 134 | +* `average_utilization` - (Optional, Int) Specifies the target value of the resource metric across all elevant pods. |
| 135 | + |
| 136 | +* `average_value` - (Optional, Map) Specifies the average value of the resource. |
| 137 | + |
| 138 | +* `type` - (Optional, String) Specifies the metric type, the value can be **Utilization**, **Value**, or **AverageValue**. |
| 139 | + |
| 140 | +* `value` - (Optional, Map) Specifies the value of the resource. |
| 141 | + |
| 142 | +<a name="block--metrics--external"></a> |
| 143 | +The `external` block supports: |
| 144 | + |
| 145 | +* `metric` - (Optional, List) Specifies the metric of external metric source. |
| 146 | + The [metric](#block--metrics--external--metric) structure is documented below. |
| 147 | + |
| 148 | +* `target` - (Optional, List) Specifies the target of external metric source. |
| 149 | + The [target](#block--metrics--external--target) structure is documented below. |
| 150 | + |
| 151 | +<a name="block--metrics--external--metric"></a> |
| 152 | +The `metric` block supports: |
| 153 | + |
| 154 | +* `name` - (Optional, String) Specifies the name of the given metric. |
| 155 | + |
| 156 | +* `selector` - (Optional, List) Specifies the metric of external metric source. |
| 157 | + The [selector](#block--metrics--external--metric--selector) structure is documented below. |
| 158 | + |
| 159 | +<a name="block--metrics--external--metric--selector"></a> |
| 160 | +The `selector` block supports: |
| 161 | + |
| 162 | +* `match_expressions` - (Optional, List) Specifies the match expressions of the label selector requirements. |
| 163 | + The [match_expressions](#block--metrics--external--metric--selector--match_expressions) structure is documented below. |
| 164 | + |
| 165 | +* `match_labels` - (Optional, Map) Specifies the match labels. |
| 166 | + |
| 167 | +<a name="block--metrics--external--metric--selector--match_expressions"></a> |
| 168 | +The `match_expressions` block supports: |
| 169 | + |
| 170 | +* `key` - (Optional, String) Specifies the label key that the selector applies to. |
| 171 | + |
| 172 | +* `operator` - (Optional, String) Specifies the operator represents a key relationship to a set of values. |
| 173 | + |
| 174 | +* `values` - (Optional, Map) Specifies the array of string values. |
| 175 | + |
| 176 | +<a name="block--metrics--external--target"></a> |
| 177 | +The `target` block supports: |
| 178 | + |
| 179 | +* `average_utilization` - (Optional, Int) Specifies the target value of the resource metric across all elevant pods. |
| 180 | + |
| 181 | +* `average_value` - (Optional, Map) Specifies the average value of the resource. |
| 182 | + |
| 183 | +* `type` - (Optional, String) Specifies the metric type, the value can be **Utilization**, **Value**, or **AverageValue**. |
| 184 | + |
| 185 | +* `value` - (Optional, Map) Specifies the value of the resource. |
| 186 | + |
| 187 | +<a name="block--metrics--object"></a> |
| 188 | +The `object` block supports: |
| 189 | + |
| 190 | +* `described_object` - (Optional, List) Specifies the container resource metric source. |
| 191 | + The [described_object](#block--metrics--object--described_object) structure is documented below. |
| 192 | + |
| 193 | +* `metric` - (Optional, List) Specifies the container resource metric source. |
| 194 | + The [metric](#block--metrics--object--metric) structure is documented below. |
| 195 | + |
| 196 | +* `target` - (Optional, List) Specifies the container resource metric source. |
| 197 | + The [target](#block--metrics--object--target) structure is documented below. |
| 198 | + |
| 199 | +<a name="block--metrics--object--described_object"></a> |
| 200 | +The `described_object` block supports: |
| 201 | + |
| 202 | +* `api_version` - (Optional, String) Specifies the API version of the referent. |
| 203 | + |
| 204 | +* `kind` - (Optional, String) Specifies the kind of the referent. |
| 205 | + |
| 206 | +* `name` - (Optional, String) Specifies the name of the referent. |
| 207 | + |
| 208 | +<a name="block--metrics--object--metric"></a> |
| 209 | +The `metric` block supports: |
| 210 | + |
| 211 | +* `name` - (Optional, String) Specifies the name of the given metric. |
| 212 | + |
| 213 | +* `selector` - (Optional, String) Specifies the metric of external metric source. |
| 214 | + The [selector](#block--metrics--object--metric--selector) structure is documented below. |
| 215 | + |
| 216 | +<a name="block--metrics--object--metric--selector"></a> |
| 217 | +The `selector` block supports: |
| 218 | + |
| 219 | +* `match_expressions` - (Optional, String) Specifies the match expressions of the label selector requirements. |
| 220 | + The [match_expressions](#block--metrics--object--metric--selector--match_expressions) structure is documented below. |
| 221 | + |
| 222 | +* `match_labels` - (Optional, String) Specifies the match labels. |
| 223 | + |
| 224 | +<a name="block--metrics--object--metric--selector--match_expressions"></a> |
| 225 | +The `match_expressions` block supports: |
| 226 | + |
| 227 | +* `key` - (Optional, String) Specifies the label key that the selector applies to. |
| 228 | + |
| 229 | +* `operator` - (Optional, String) Specifies the operator represents a key relationship to a set of values. |
| 230 | + |
| 231 | +* `values` - (Optional, String) Specifies the array of string values. |
| 232 | + |
| 233 | +<a name="block--metrics--object--target"></a> |
| 234 | +The `target` block supports: |
| 235 | + |
| 236 | +* `average_utilization` - (Optional, Int) Specifies the target value of the resource metric across all elevant pods. |
| 237 | + |
| 238 | +* `average_value` - (Optional, Map) Specifies the average value of the resource. |
| 239 | + |
| 240 | +* `type` - (Optional, String) Specifies the metric type, the value can be **Utilization**, **Value**, or **AverageValue**. |
| 241 | + |
| 242 | +* `value` - (Optional, Map) Specifies the value of the resource. |
| 243 | + |
| 244 | +<a name="block--metrics--pods"></a> |
| 245 | +The `pods` block supports: |
| 246 | + |
| 247 | +* `metric` - (Optional, List) Specifies the container resource pod metric source. |
| 248 | + The [metric](#block--metrics--pods--metric) structure is documented below. |
| 249 | + |
| 250 | +* `target` - (Optional, List) Specifies the container resource pod metric source. |
| 251 | + The [target](#block--metrics--pods--target) structure is documented below. |
| 252 | + |
| 253 | +<a name="block--metrics--pods--metric"></a> |
| 254 | +The `metric` block supports: |
| 255 | + |
| 256 | +* `name` - (Optional, String) Specifies the name of the given metric. |
| 257 | + |
| 258 | +* `selector` - (Optional, String) Specifies the metric of external metric source. |
| 259 | + The [selector](#block--metrics--pods--metric--selector) structure is documented below. |
| 260 | + |
| 261 | +<a name="block--metrics--pods--metric--selector"></a> |
| 262 | +The `selector` block supports: |
| 263 | + |
| 264 | +* `match_expressions` - (Optional, String) Specifies the match expressions of the label selector requirements. |
| 265 | + The [match_expressions](#block--metrics--pods--metric--selector--match_expressions) structure is documented below. |
| 266 | + |
| 267 | +* `match_labels` - (Optional, String) Specifies the match labels. |
| 268 | + |
| 269 | +<a name="block--metrics--pods--metric--selector--match_expressions"></a> |
| 270 | +The `match_expressions` block supports: |
| 271 | + |
| 272 | +* `key` - (Optional, String) Specifies the label key that the selector applies to. |
| 273 | + |
| 274 | +* `operator` - (Optional, String) Specifies the operator represents a key relationship to a set of values. |
| 275 | + |
| 276 | +* `values` - (Optional, String) Specifies the array of string values. |
| 277 | + |
| 278 | +<a name="block--metrics--pods--target"></a> |
| 279 | +The `target` block supports: |
| 280 | + |
| 281 | +* `average_utilization` - (Optional, Int) Specifies the target value of the resource metric across all elevant pods. |
| 282 | + |
| 283 | +* `average_value` - (Optional, Map) Specifies the average value of the resource. |
| 284 | + |
| 285 | +* `type` - (Optional, String) Specifies the metric type. |
| 286 | + The value can be **Utilization**, **Value**, or **AverageValue**. |
| 287 | + |
| 288 | +* `value` - (Optional, Map) Specifies the value of the resource. |
| 289 | + |
| 290 | +<a name="block--metrics--resource"></a> |
| 291 | +The `resource` block supports: |
| 292 | + |
| 293 | +* `name` - (Optional, String) Specifies the name of the resource in question. |
| 294 | + |
| 295 | +* `target` - (Optional, List) Specifies the container resource pod metric source. |
| 296 | + The [target](#block--metrics--resource--target) structure is documented below. |
| 297 | + |
| 298 | +<a name="block--metrics--resource--target"></a> |
| 299 | +The `target` block supports: |
| 300 | + |
| 301 | +* `average_utilization` - (Optional, Int) Specifies the target value of the resource metric across all elevant pods. |
| 302 | + |
| 303 | +* `average_value` - (Optional, Map) Specifies the average value of the resource. |
| 304 | + |
| 305 | +* `type` - (Optional, String) Specifies the metric type. |
| 306 | + The value can be **Utilization**, **Value**, or **AverageValue**. |
| 307 | + |
| 308 | +* `value` - (Optional, Map) Specifies the value of the resource. |
| 309 | + |
| 310 | +<a name="block--scale_target_ref"></a> |
| 311 | +The `scale_target_ref` block supports: |
| 312 | + |
| 313 | +* `api_version` - (Optional, String) Specifies the API version of the referent. |
| 314 | + |
| 315 | +* `kind` - (Optional, String) Specifies the kind of the referent. |
| 316 | + |
| 317 | +* `name` - (Optional, String) Specifies the name of the referent. |
| 318 | + |
| 319 | +## Attribute Reference |
| 320 | + |
| 321 | +In addition to all arguments above, the following attributes are exported: |
| 322 | + |
| 323 | +* `id` - The resource ID. |
| 324 | + |
| 325 | +* `api_version` - The API version of the CCI Image Snapshot. |
| 326 | + |
| 327 | +* `creation_timestamp` - The creation timestamp of the CCI Image Snapshot. |
| 328 | + |
| 329 | +* `kind` - The kind of the CCI Image Snapshot. |
| 330 | + |
| 331 | +* `resource_version` - The resource version of the CCI Image Snapshot. |
| 332 | + |
| 333 | +* `status` - The status. |
| 334 | + The [status](#attrblock--status) structure is documented below. |
| 335 | + |
| 336 | +* `uid` - The uid of the CCI Image Snapshot. |
| 337 | + |
| 338 | +<a name="attrblock--status"></a> |
| 339 | +The `status` block supports: |
| 340 | + |
| 341 | +* `conditions` - The status. |
| 342 | + The [conditions](#attrblock--status--conditions) structure is documented below. |
| 343 | + |
| 344 | +* `current_metrics` - The status. |
| 345 | + The [current_metrics](#attrblock--status--current_metrics) structure is documented below. |
| 346 | + |
| 347 | +* `current_replicas` - The current replicas. |
| 348 | + |
| 349 | +* `desired_replicas` - The desired replicas. |
| 350 | + |
| 351 | +* `last_scale_time` - The last scale time. |
| 352 | + |
| 353 | +* `observed_generation` - The observed generation. |
| 354 | + |
| 355 | +<a name="attrblock--status--conditions"></a> |
| 356 | +The `conditions` block supports: |
| 357 | + |
| 358 | +* `last_transition_time` - The last transition time of the conditions. |
| 359 | + |
| 360 | +* `message` - The message of the conditions. |
| 361 | + |
| 362 | +* `reason` - The reason of the conditions. |
| 363 | + |
| 364 | +* `status` - Tthe status of the conditions. |
| 365 | + |
| 366 | +* `type` - The type of the conditions. |
| 367 | + |
| 368 | +<a name="attrblock--status--current_metrics"></a> |
| 369 | +The `current_metrics` block supports: |
| 370 | + |
| 371 | +## Import |
| 372 | + |
| 373 | +The xxx can be imported using `id`, e.g. |
| 374 | + |
| 375 | +```bash |
| 376 | +$ terraform import huaweicloud_cciv2_horizontal_pod_autoscaler.test <id> |
| 377 | +``` |
0 commit comments