forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maksymilian Boguń
committed
Mar 13, 2019
1 parent
c78baff
commit 78d5b21
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
layout: "azurerm" | ||
page_title: "Azure Resource Manager: azurerm_iothub_shared_access_policy" | ||
sidebar_current: "docs-azurerm-resource-messaging-iothub-shared-access-policy-x" | ||
description: |- | ||
Manages an IotHub Shared Access Policy | ||
--- | ||
|
||
# azurerm_iothub_shared_access_policy | ||
|
||
Manages an IotHub Shared Access Policy | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "azurerm_resource_group" "test" { | ||
name = "resourceGroup1" | ||
location = "West US" | ||
} | ||
resource "azurerm_iothub" "test" { | ||
name = "test" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
location = "${azurerm_resource_group.test.location}" | ||
sku { | ||
name = "S1" | ||
tier = "Standard" | ||
capacity = "1" | ||
} | ||
} | ||
resource "azurerm_iothub_shared_access_policy" "test" { | ||
name = "test" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
iothub_name = "${azurerm_iothub.test.name}" | ||
registry_read = true | ||
registry_write = true | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) Specifies the name of the IotHub Shared Access Policy resource. Changing this forces a new resource to be created. | ||
|
||
* `resource_group_name` - (Required) The name of the resource group under which the IotHub Shared Access Policy resource has to be created. Changing this forces a new resource to be created. | ||
|
||
* `iothub_name` - (Required) The name of the IoTHub to which this Shared Access Policy belongs. Changing this forces a new resource to be created. | ||
|
||
* `registry_read` - (Optional) Adds `RegistryRead` permission to this Shared Access Account. It allows read access to the identity registry. | ||
|
||
* `registry_write` - (Optional) Adds `RegistryWrite` permission to this Shared Access Account. It allows write access to the identity registry. | ||
|
||
-> **NOTE** When `registry_write` is set to `true`, `registry_read` must also be set to true. This is a limitation of the Azure REST API | ||
|
||
* `service_connect` - (Optional) Adds `ServiceConnect` permission to this Shared Access Account. It allows sending and receiving on the cloud-side endpoints. | ||
|
||
* `device_connect` - (Optional) Adds `DeviceConnect` permission to this Shared Access Account. It allows sending and receiving on the device-side endpoints. | ||
|
||
-> **NOTE** At least one of `registry_read`, `registry_write`, `service_connect`, `device_connect` permissions must be set to `true`. | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The ID of the IoTHub Shared Access Policy. | ||
|
||
* `primary_key` - The primary key used to create the authentication token. | ||
|
||
* `secondary_key` - The secondary key used to create the authentication token. | ||
|
||
## Import | ||
|
||
IoTHub Shared Access Policies can be imported using the `resource id`, e.g. | ||
|
||
```shell | ||
terraform import azurerm_iothub_shared_access_policy.shared_access_policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/IotHubs/hub1/IotHubKeys/shared_access_policy1 | ||
``` |