lonegunmanb feedback

This commit is contained in:
Kelly Gremban 2022-10-12 11:43:29 -07:00
parent 8a9f0ff064
commit db43ecd3a5
4 changed files with 9 additions and 15 deletions

View File

@ -30,12 +30,12 @@ resource "azurerm_storage_container" "my_terraform_container" {
# Create an Event Hub & Authorization Rule # Create an Event Hub & Authorization Rule
resource "random_pet" "eventhubnamespace_name" { resource "random_pet" "eventhub_namespace_name" {
prefix = var.eventhub_namespace_name_prefix prefix = var.eventhub_namespace_name_prefix
} }
resource "azurerm_eventhub_namespace" "namespace" { 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 resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg.location
sku = "Basic" sku = "Basic"
@ -129,7 +129,7 @@ resource "azurerm_iothub" "iothub" {
} }
#Create IoT Hub Access Policy #Create IoT Hub Access Policy
resource "azurerm_iothub_shared_access_policy" "hubaccesspolicy" { resource "azurerm_iothub_shared_access_policy" "hub_access_policy" {
name = "terraform-policy" name = "terraform-policy"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg.name
iothub_name = azurerm_iothub.iothub.name iothub_name = azurerm_iothub.iothub.name
@ -157,7 +157,7 @@ resource "azurerm_iothub_dps" "dps" {
} }
linked_hub { 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 location = azurerm_resource_group.rg.location
allocation_weight = 150 allocation_weight = 150
apply_allocation_policy = true apply_allocation_policy = true

View File

@ -1,10 +1,10 @@
terraform { terraform {
required_version = ">=0.12" required_version = ">=1.0"
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~>2.0" version = ">=3.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"

View File

@ -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_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` | | `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` | | `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` | | `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` | | `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` |

View File

@ -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." 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" { variable "eventhub_namespace_name_prefix" {
default = "namespace" 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." description = "Prefix of the event hub namespace name that's combined with a random ID so name is unique in your Azure subscription."