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

fix(intance): fix default value for placement group #329

Merged
merged 1 commit into from
Nov 19, 2019
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
2 changes: 1 addition & 1 deletion scaleway/resource_instance_placement_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func resourceScalewayInstancePlacementGroup() *schema.Resource {
"policy_type": {
Type: schema.TypeString,
Optional: true,
Default: instance.PlacementGroupPolicyTypeLowLatency.String(),
Default: instance.PlacementGroupPolicyTypeMaxAvailability.String(),
Description: "The operating mode is selected by a policy_type",
ValidateFunc: validation.StringInSlice([]string{
instance.PlacementGroupPolicyTypeLowLatency.String(),
Expand Down
12 changes: 6 additions & 6 deletions scaleway/resource_instance_placement_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func TestAccScalewayInstancePlacementGroup(t *testing.T) {
testAccCheckScalewayInstancePlacementGroupExists("scaleway_instance_placement_group.base"),
testAccCheckScalewayInstancePlacementGroupExists("scaleway_instance_placement_group.scaleway"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_mode", "optional"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_type", "low_latency"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_type", "max_availability"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_mode", "enforced"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_type", "max_availability"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_type", "low_latency"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_respected", "true"),
),
},
Expand All @@ -33,10 +33,10 @@ func TestAccScalewayInstancePlacementGroup(t *testing.T) {
testAccCheckScalewayInstancePlacementGroupExists("scaleway_instance_placement_group.base"),
testAccCheckScalewayInstancePlacementGroupExists("scaleway_instance_placement_group.scaleway"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_mode", "enforced"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_type", "max_availability"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_type", "low_latency"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.base", "policy_respected", "true"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_mode", "optional"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_type", "low_latency"),
resource.TestCheckResourceAttr("scaleway_instance_placement_group.scaleway", "policy_type", "max_availability"),
),
},
},
Expand Down Expand Up @@ -104,13 +104,13 @@ var testAccScalewayInstancePlacementGroupConfig = []string{
resource "scaleway_instance_placement_group" "base" {}
resource "scaleway_instance_placement_group" "scaleway" {
policy_mode = "enforced"
policy_type = "max_availability"
policy_type = "low_latency"
}
`,
`
resource "scaleway_instance_placement_group" "base" {
policy_mode = "enforced"
policy_type = "max_availability"
policy_type = "low_latency"
}
resource "scaleway_instance_placement_group" "scaleway" {}
`,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_placement_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "scaleway_instance_placement_group" "availability_group" {}
The following arguments are supported:

- `name` - (Optional) The name of the placement group.
- `policy_type` - (Defaults to `low_latency`) The [policy type](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) of the placement group. Possible values are: `low_latency` or `max_availability`.
- `policy_type` - (Defaults to `max_availability`) The [policy type](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) of the placement group. Possible values are: `low_latency` or `max_availability`.
- `policy_mode` - (Defaults to `optional`) The [policy mode](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) of the placement group. Possible values are: `optional` or `enforced`.
- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the placement group should be created.
- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the project the placement group is associated with.
Expand Down