From db43ecd3a56c0fe5ac0b36503d3eef10e3502cb5 Mon Sep 17 00:00:00 2001 From: Kelly Gremban Date: Wed, 12 Oct 2022 11:43:29 -0700 Subject: [PATCH] lonegunmanb feedback --- .../main.tf | 14 +++++++------- .../providers.tf | 4 ++-- .../readme.md | 1 - .../variables.tf | 5 ----- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/quickstart/201-iot-hub-with-device-provisioning-service/main.tf b/quickstart/201-iot-hub-with-device-provisioning-service/main.tf index d362026c..1009e0d0 100644 --- a/quickstart/201-iot-hub-with-device-provisioning-service/main.tf +++ b/quickstart/201-iot-hub-with-device-provisioning-service/main.tf @@ -9,9 +9,9 @@ resource "azurerm_resource_group" "rg" { # Create storage account & container resource "random_string" "sa_name" { - length = 12 + length = 12 special = false - upper = false + upper = false } resource "azurerm_storage_account" "sa" { @@ -30,12 +30,12 @@ resource "azurerm_storage_container" "my_terraform_container" { # Create an Event Hub & Authorization Rule -resource "random_pet" "eventhubnamespace_name" { +resource "random_pet" "eventhub_namespace_name" { prefix = var.eventhub_namespace_name_prefix } resource "azurerm_eventhub_namespace" "namespace" { - name = random_pet.eventhubnamespace_name.id + name = random_pet.eventhub_namespace_name.id resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location sku = "Basic" @@ -82,7 +82,7 @@ resource "azurerm_iothub" "iothub" { max_chunk_size_in_bytes = 10485760 container_name = azurerm_storage_container.my_terraform_container.name encoding = "Avro" - file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}" + file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}" } endpoint { @@ -129,7 +129,7 @@ resource "azurerm_iothub" "iothub" { } #Create IoT Hub Access Policy -resource "azurerm_iothub_shared_access_policy" "hubaccesspolicy" { +resource "azurerm_iothub_shared_access_policy" "hub_access_policy" { name = "terraform-policy" resource_group_name = azurerm_resource_group.rg.name iothub_name = azurerm_iothub.iothub.name @@ -157,7 +157,7 @@ resource "azurerm_iothub_dps" "dps" { } linked_hub { - connection_string = azurerm_iothub_shared_access_policy.hubaccesspolicy.primary_connection_string + connection_string = azurerm_iothub_shared_access_policy.hub_access_policy.primary_connection_string location = azurerm_resource_group.rg.location allocation_weight = 150 apply_allocation_policy = true diff --git a/quickstart/201-iot-hub-with-device-provisioning-service/providers.tf b/quickstart/201-iot-hub-with-device-provisioning-service/providers.tf index 5343d826..fa0c5391 100644 --- a/quickstart/201-iot-hub-with-device-provisioning-service/providers.tf +++ b/quickstart/201-iot-hub-with-device-provisioning-service/providers.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">=0.12" + required_version = ">=1.0" required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~>2.0" + version = ">=3.0" } random = { source = "hashicorp/random" diff --git a/quickstart/201-iot-hub-with-device-provisioning-service/readme.md b/quickstart/201-iot-hub-with-device-provisioning-service/readme.md index e056e328..e3356c23 100644 --- a/quickstart/201-iot-hub-with-device-provisioning-service/readme.md +++ b/quickstart/201-iot-hub-with-device-provisioning-service/readme.md @@ -22,7 +22,6 @@ This template deploys an instance of [Device Provisioning Service](https://learn | ---- | ----------- | ------- | | `resource_group_location` | Location of the resource group. | `eastus` | | `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so the name is unique in your Azure subscription. | `rg` | -| `storage_account_name_prefix` | Prefix of the storage account name that's combined with a random ID so name is unique in your Azure subscription. | `sa` | | `eventhub_namespace_name_prefix` | Prefix of the event hub namespace name that's combined with a random ID so the name is unique in your Azure subscription. | `namespace` | | `iothub_name_prefix` | Prefix of the IoT hub name that's combined with a random ID so the name is unique in your Azure subscription. | `iothub` | | `dps_name_prefix` | Prefix of the dps name that's combined with a random ID so the name is unique in your Azure subscription. | `dps` | diff --git a/quickstart/201-iot-hub-with-device-provisioning-service/variables.tf b/quickstart/201-iot-hub-with-device-provisioning-service/variables.tf index 5c424c59..3daf4b0e 100644 --- a/quickstart/201-iot-hub-with-device-provisioning-service/variables.tf +++ b/quickstart/201-iot-hub-with-device-provisioning-service/variables.tf @@ -8,11 +8,6 @@ variable "resource_group_name_prefix" { description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." } -variable "storage_account_name_prefix" { - default = "sa" - description = "Prefix of the storage account name that's combined with a random ID so name is unique in your Azure subscription." -} - variable "eventhub_namespace_name_prefix" { default = "namespace" description = "Prefix of the event hub namespace name that's combined with a random ID so name is unique in your Azure subscription."