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

Update azurerm_orchestrated_virtual_machine_scale_set - Remove the validation for single_placement_group #7821

Merged
merged 5 commits into from
Aug 11, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ func resourceArmOrchestratedVirtualMachineScaleSet() *schema.Resource {
},

"single_placement_group": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: false,
Deprecated: "Due to an upgrade of the compute API this preview property has now been deprecated and required to be false in the 2019-12-01 api versions for orchestrated VMSS - as it will always be false for the current and future API versions this property now defaults to false and will removed in version 3.0 of the provider.",
ValidateFunc: validateBoolIsFalse,
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: false,
},

// the VMO mode can only be deployed into one zone for now, and its zone will also be assigned to all its VM instances
Expand Down Expand Up @@ -214,17 +212,3 @@ func resourceArmOrchestratedVirtualMachineScaleSetDelete(d *schema.ResourceData,

return nil
}

func validateBoolIsFalse(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(bool)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %s to be boolean", k))
return
}

if v {
errors = append(errors, fmt.Errorf("%q can only be false", k))
}

return
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ description: |-

Manages an Orchestrated Virtual Machine Scale Set.

-> **Note:** Orchestrated Virtual Machine Scale Sets are in Public Preview - [more details can be found in the Azure Documentation](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/orchestration-modes).
-> **Note:** Orchestrated Virtual Machine Scale Sets are in Public Preview and it may receive breaking changes - [more details can be found in the Azure Documentation](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/orchestration-modes).

-> **Note:** Azure has deprecated the `single_placement_group` attribute in the Orchestrated Virtual Machine Scale Set since api-version 2019-12-01 and there is a breaking change in the Orchestrated Virtual Machine Scale Set. If you have an Orchestrated Virtual Machine Scale Set created using `azurerm` provider version `<=2.13.0` you will have to remove the `single_placement_group` attribute in your config and recreate the resource to have it managed by terraform.
-> **Note:** Azure is planning to deprecate the `single_placement_group` attribute in the Orchestrated Virtual Machine Scale Set starting from api-version `2019-12-01` and there will be a breaking change in the Orchestrated Virtual Machine Scale Set.

## Example Usage

Expand Down Expand Up @@ -49,9 +49,7 @@ The following arguments are supported:

* `proximity_placement_group_id` - (Optional) The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. Changing this forces a new resource to be created.

* `single_placement_group` - (Optional / **Deprecated**) Should the Orchestrated Virtual Machine Scale Set use single placement group?

~> **NOTE:** Due to a limitation of the Azure API at this time, you can only assign `single_placement_group` to `false`.
* `single_placement_group` - (Optional) Should the Orchestrated Virtual Machine Scale Set use single placement group? Defaults to `false`.

* `zones` - (Optional) A list of Availability Zones in which the Virtual Machines in this Scale Set should be created in. Changing this forces a new resource to be created.

Expand Down