Skip to content

Commit

Permalink
azurerm_iot_hub: fix documentation example (#5503)
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored Jan 23, 2020
1 parent e99ab5a commit 2a1ac4f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ resource "azurerm_iothub" "test" {
name = "export"
batch_frequency_in_seconds = 60
max_chunk_size_in_bytes = 10485760
container_name = "test"
container_name = "${azurerm_storage_container.test.name}"
encoding = "Avro"
file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"
}
Expand Down
61 changes: 42 additions & 19 deletions website/docs/r/iothub.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,49 @@ Manages an IotHub

```hcl
resource "azurerm_resource_group" "example" {
name = "resourceGroup1"
location = "West US"
name = "example-resources"
location = "Canada Central"
}
resource "azurerm_storage_account" "example" {
name = "teststa"
name = "examplestorage"
resource_group_name = "${azurerm_resource_group.example.name}"
location = "${azurerm_resource_group.example.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "example" {
name = "test"
resource_group_name = "${azurerm_resource_group.example.name}"
name = "examplecontainer"
storage_account_name = "${azurerm_storage_account.example.name}"
container_access_type = "private"
}
resource "azurerm_eventhub_namespace" "example" {
name = "example-namesapce"
resource_group_name = "${azurerm_resource_group.example.name}"
location = "${azurerm_resource_group.example.location}"
sku = "Basic"
}
resource "azurerm_eventhub" "example" {
name = "example-eventhub"
resource_group_name = "${azurerm_resource_group.example.name}"
namespace_name = "${azurerm_eventhub_namespace.example.name}"
partition_count = 2
message_retention = 1
}
resource "azurerm_eventhub_authorization_rule" "example" {
resource_group_name = "${azurerm_resource_group.example.name}"
namespace_name = "${azurerm_eventhub_namespace.example.name}"
eventhub_name = "${azurerm_eventhub.example.name}"
name = "acctest"
send = true
}
resource "azurerm_iothub" "example" {
name = "test"
name = "Example-IoTHub"
resource_group_name = "${azurerm_resource_group.example.name}"
location = "${azurerm_resource_group.example.location}"
Expand All @@ -55,11 +77,17 @@ resource "azurerm_iothub" "example" {
name = "export"
batch_frequency_in_seconds = 60
max_chunk_size_in_bytes = 10485760
container_name = "test"
container_name = "${azurerm_storage_container.example.name}"
encoding = "Avro"
file_name_format = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"
}
endpoint {
type = "AzureIotHub.EventHub"
connection_string = "${azurerm_eventhub_authorization_rule.example.primary_connection_string}"
name = "export2"
}
route {
name = "export"
source = "DeviceMessages"
Expand All @@ -68,24 +96,19 @@ resource "azurerm_iothub" "example" {
enabled = true
}
fallback_route {
enabled = true
}
file_upload {
connection_string = "${azurerm_storage_account.example.primary_blob_connection_string}"
container_name = "${azurerm_storage_container.example.name}"
sas_ttl = "PT1H"
notifications = true
lock_duration = "PT1M"
default_ttl = "PT1H"
max_delivery_count = 10
route {
name = "export2"
source = "DeviceMessages"
condition = "true"
endpoint_names = ["export2"]
enabled = true
}
tags = {
purpose = "testing"
}
}
```

## Argument Reference
Expand Down

0 comments on commit 2a1ac4f

Please sign in to comment.