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 iothub to 2.0 #5790

Merged
merged 6 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 1 addition & 15 deletions azurerm/internal/services/iothub/resource_arm_iothub.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,7 @@ func resourceArmIotHub() *schema.Resource {
string(devices.S1),
string(devices.S2),
string(devices.S3),
}, true), // todo 2.0 make this case sensitive (all constants?)
},

"tier": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: "This property is no longer required and will be removed in version 2.0 of the provider",
DiffSuppressFunc: suppress.CaseDifference,
ValidateFunc: validation.StringInSlice([]string{
string(devices.Basic),
string(devices.Free),
string(devices.Standard),
}, true),
}, false),
},

"capacity": {
Expand Down Expand Up @@ -880,7 +867,6 @@ func flattenIoTHubSku(input *devices.IotHubSkuInfo) []interface{} {
output := make(map[string]interface{})

output["name"] = string(input.Name)
output["tier"] = string(input.Tier)
if capacity := input.Capacity; capacity != nil {
output["capacity"] = int(*capacity)
}
Expand Down
15 changes: 1 addition & 14 deletions azurerm/internal/services/iothub/resource_arm_iothub_dps.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,7 @@ func resourceArmIotHubDPS() *schema.Resource {
string(devices.S1),
string(devices.S2),
string(devices.S3),
}, true), // todo 2.0 make this case sensitive
},

"tier": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: "This property is no longer required and will be removed in version 2.0 of the provider",
ValidateFunc: validation.StringInSlice([]string{
string(devices.Basic),
string(devices.Free),
string(devices.Standard),
}, true),
}, false),
},

"capacity": {
Expand Down Expand Up @@ -354,7 +342,6 @@ func flattenIoTHubDPSSku(input *iothub.IotDpsSkuInfo) []interface{} {
output := make(map[string]interface{})

output["name"] = string(input.Name)
output["tier"] = input.Tier
if capacity := input.Capacity; capacity != nil {
output["capacity"] = int(*capacity)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ resource "azurerm_iothub" "import" {

sku {
name = "B1"
tier = "Basic"
capacity = "1"
}

Expand Down
4 changes: 4 additions & 0 deletions website/docs/guides/2.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,14 @@ The deprecated `internal_public_ip_address_id` field in the `ip_configuration` b

The deprecated `sku.tier` property will be remove.

The `sku.name` property is now case sensitive.

### Resource: `azurerm_iothub_dps`

The deprecated `sku.tier` property will be remove.

The `sku.name` property is now case sensitive.

### Resource: `azurerm_iot_dps`

This resource has been renamed to `azurerm_iothub_dps` which is available from v1.37 of the AzureRM Provider - instructions on [how to migrate are available in this guide](https://terraform.io/docs/providers/azurerm/guides/migrating-between-renamed-resources.html). As such this resource will be removed.
Expand Down
4 changes: 0 additions & 4 deletions website/docs/r/iothub.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ A `sku` block supports the following:

* `name` - (Required) The name of the sku. Possible values are `B1`, `B2`, `B3`, `F1`, `S1`, `S2`, and `S3`.

* `tier` - (Required) The billing tier for the IoT Hub. Possible values are `Basic`, `Free` or `Standard`.

~> **NOTE:** Only one IotHub can be on the `Free` tier per subscription.

* `capacity` - (Required) The number of provisioned IoT Hub units.

---
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/iothub_dps.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ A `sku` block supports the following:

* `name` - (Required) The name of the sku. Possible values are `B1`, `B2`, `B3`, `F1`, `S1`, `S2`, and `S3`.

* `tier` - (Required) The billing tier for the IoT Device Provisioning Service. Possible values are `Basic`, `Free` or `Standard`.

* `capacity` - (Required) The number of provisioned IoT Device Provisioning Service units.

---
Expand Down