Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instanceFlexibilityPolicy to google_compute_region_instance_group_manager #20132

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/12163.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: added new field `instance_flexibility_policy` to resource `google_compute_region_instance_group_manager`
```
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ func ResourceComputeRegionInstanceGroupManager() *schema.Resource {
ValidateFunc: validation.IntBetween(0, 100),
Description: `Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.`,
},

"instance_redistribution_type": {
Type: schema.TypeString,
Optional: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ func TestAccRegionInstanceGroupManager_stateful(t *testing.T) {
},
})
}

func TestAccRegionInstanceGroupManager_APISideListRecordering(t *testing.T) {
t.Parallel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ group. You can specify one or more values. For more information, see the [offici

* `params` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) Input only additional params for instance group manager creation. Structure is [documented below](#nested_params). For more information, see [API](https://cloud.google.com/compute/docs/reference/rest/beta/instanceGroupManagers/insert).

* `instance_flexibility_policy` - (Optional [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) The flexibility policy for managed instance group. Instance flexibility allows managed instance group to create VMs from multiple types of machines. Instance flexibility configuration on managed instance group overrides instance template configuration. Structure is [documented below](#nested_instance_flexibility_policy).
- - -

The `standby_policy` block supports:
Expand Down Expand Up @@ -262,7 +263,35 @@ instance_lifecycle_policy {
* `default_action_on_failure` - (Optional), Default behavior for all instance or health check failures. Valid options are: `REPAIR`, `DO_NOTHING`. If `DO_NOTHING` then instances will not be repaired. If `REPAIR` (default), then failed instances will be repaired.

- - -
<a name="nested_instance_flexibility_policy"></a>The `instance_flexibility_policy` block supports:

```hcl
instance_flexibility_policy {
instance_selections {
name = "instance_selection_name"
rank = 1
machine_types = ["n1-standard-16"]
}
}
```

* `instance_selections` - (Optional), Named instance selections configuring properties that the group will use when creating new VMs. One can specify multiple instance selection to allow managed instance group to create VMs from multiple types of machines, based on preference and availability. Structure is [documented below](#nested_instance_selections).
- - -
<a name="nested_instance_selections"></a>The `instance_selections` block supports:

```hcl
instance_selections {
name = "instance_selection_name"
rank = 1
machine_types = ["n1-standard-1", "n1-standard-16"]
}
```

* `name` - (Required), Name of the instance selection, e.g. instance_selection_with_n1_machines_types. Instance selection names must be unique within the flexibility policy.
* `rank` - (Optional), Preference of this instance selection. Lower number means higher preference. Managed instance group will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.
* `machine_types` - (Required), A list of full machine-type names, e.g. "n1-standard-16".

- - -
<a name="nested_all_instances_config"></a>The `all_instances_config` block supports:

```hcl
Expand Down