Create or update any Azure resource.
This module provisions the following resources:
Tip💡 Use native Terraform resources where possible rather than ARM Templates.
Noteazurerm_template_deployment
resource, Terraform will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal.
Example 1 (Integration Account):
resource "azurerm_resource_group" "integration_account" {
name = "my-integration-account-rg"
location = "westeurope"
}
module "integration_account" {
source = "innovationnorway/resource/azurerm"
api_version = "2016-06-01"
type = "Microsoft.Logic/IntegrationAccounts"
name = "my-integration-account"
resource_group_name = "${azurerm_resource_group.integration_account.name}"
location = "${azurerm_resource_group.integration_account.location}"
sku {
name = "Standard"
}
}
output "integration_account_id" {
value = "${module.integration_account.id}"
}
Example 2 (API Management Service):
resource "azurerm_resource_group" "api_management" {
name = "my-api-management-rg"
location = "westeurope"
}
module "api_management" {
source = "innovationnorway/resource/azurerm"
api_version = "2018-01-01"
type = "Microsoft.ApiManagement/service"
name = "my-api-management-service"
resource_group_name = "${azurerm_resource_group.api_management.name}"
location = "${azurerm_resource_group.api_management.location}"
properties {
publisherEmail = "[email protected]"
publisherName = "ACME Corp"
}
sku {
name = "Developer"
capacity = 1
}
}
output "api_management_service_id" {
value = "${module.integration_account.id}"
}
(Required) Name of the resource.
(Required) The name of the resource group in which to create the template deployment.
(Optional) Specifies the supported Azure location. Most resource types require a location, but some types (such as a role assignment) don't require a location.
(Required) Version of the REST API to use for creating the resource.
Specifies the mode that is used to deploy resources. This value could be either Incremental
or Complete
. Note that you will almost always want this to be set to Incremental
otherwise the deployment will destroy all infrastructure not specified within the template, and Terraform will not be aware of this. Default is Incremental
.
(Required) Type of the resource. This value is a combination of the namespace of the resource provider and the resource type (such as Microsoft.Storage/storageAccounts
).
(Optional) Some resources allow values that define the plan to deploy. For example, you can specify the marketplace image for a virtual machine.
(Optional) Resource-specific configuration settings. The values for the properties are the same as the values you provide in the request body for the REST API operation (PUT method) to create the resource.
(Optional) Some resources allow values that define the SKU to deploy. For example, you can specify the type of redundancy for a storage account.
(Optional) Some resources allow a value that defines the type of resource you deploy. For example, you can specify the type of Cosmos DB to create.
Tags that are associated with the resource.
The resource ID.
The template deployment ID.