dependency/azapi_examples/Microsoft.ApiManagement_service_apis@2021-08-01/main.tf (79 lines of code) (raw):
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "service" {
type = "Microsoft.ApiManagement/service@2021-08-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
certificates = [
]
customProperties = {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30" = "false"
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10" = "false"
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11" = "false"
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10" = "false"
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11" = "false"
}
disableGateway = false
publicNetworkAccess = "Enabled"
publisherEmail = "pub1@email.com"
publisherName = "pub1"
virtualNetworkType = "None"
}
sku = {
capacity = 0
name = "Consumption"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "api" {
type = "Microsoft.ApiManagement/service/apis@2021-08-01"
parent_id = azapi_resource.service.id
name = "${var.resource_name};rev=1"
body = {
properties = {
apiRevisionDescription = ""
apiType = "http"
apiVersion = ""
apiVersionDescription = ""
authenticationSettings = {
}
description = ""
displayName = "api1"
path = "api1"
protocols = [
"https",
]
serviceUrl = ""
subscriptionRequired = true
type = "http"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}