Manages an IotHub Certificate.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_iothub" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku {
name = "B1"
capacity = "1"
}
}
resource "azurerm_iothub_certificate" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
iothub_name = azurerm_iothub.example.name
is_verified = true
certificate_content = filebase64("example.cer")
}
The following arguments are supported:
name
- (Required) Specifies the name of the IotHub Certificate resource. Changing this forces a new resource to be created.
resource_group_name
- (Required) The name of the resource group under which the IotHub Certificate resource has to be created. Changing this forces a new resource to be created.
iothub_name
- (Required) The name of the IoTHub that this certificate will be attached to. Changing this forces a new resource to be created.
certificate_content
- (Required) The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
is_verified
- (Optional) Is the certificate verified? Defaults to false
.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the IoTHub Certificate.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the IotHub Certificate.update
- (Defaults to 30 minutes) Used when updating the IotHub Certificate.read
- (Defaults to 5 minutes) Used when retrieving the IotHub Certificate.delete
- (Defaults to 30 minutes) Used when deleting the IotHub Certificate.IoTHub Certificates can be imported using the resource id
, e.g.
terraform import azurerm_iothub_certificate.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/example/certificates/example