lonegunmanb feedback
This commit is contained in:
parent
8a9f0ff064
commit
db43ecd3a5
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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` |
|
||||
|
@ -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."
|
||||
|
Loading…
x
Reference in New Issue
Block a user