Azure API Management API
This page shows how to write Terraform and Azure Resource Manager for API Management API and write them securely.
azurerm_api_management_api (Terraform)
The API in API Management can be configured in Terraform with the resource name azurerm_api_management_api
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_api" "rivers" {
name = "rivers"
display_name = "rivers"
path = "rivers"
resource_group_name = var.rg_name
api_management_name =azurerm_api_management.apim.name
resource "azurerm_api_management_api" "apim_nodo_pagamenti_api_psp_svr" {
# source = "git::https://github.com/pagopa/azurerm.git//api_management_api?ref=v1.0.16"
name = format("%s-nodo-pagamenti-psp-svr-api", var.env_short)
api_management_name = module.apim.name
resource_group_name = azurerm_resource_group.rg_api.name
resource "azurerm_api_management_api" "example" {
name = "example-api"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim.name
revision = "1"
display_name = "Example API"
resource "azurerm_api_management_api" "VodafDev" {
name = "example-api"
resource_group_name = azurerm_resource_group.VodafDev.name
api_management_name = azurerm_api_management.VodafDev.name
revision = "1"
display_name = "POI API"
resource "azurerm_api_management_api" "CloudQuickPOCAPIMAPI" {
name = "cloudquickpocsapim-api"
resource_group_name = azurerm_resource_group.CloudQuickPOCAPIMRG.name
api_management_name = azurerm_api_management.CloudQuickPOCAPIM.name
revision = "1"
display_name = "CloudQuickPOCsFirstAPI"
resource "azurerm_api_management_api" "composite-api" {
name = "composite-api"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim.name
revision = "1"
display_name = "Composite API"
resource "azurerm_api_management_api" "module" {
name = var.api_name
resource_group_name = var.rg_name
api_management_name = var.apim_name
revision = var.api_revision
display_name = var.api_display_name
resource "azurerm_api_management_api" "attdemo" {
for_each = var.apimgmtdemo
name = each.value["name"]
api_management_name = azurerm_api_management.att-apim[each.value.apim_key].name
resource_group_name = var.apimresourcegroup
revision = each.value["revision"]
resource "azurerm_api_management_api" "CloudQuickPOCAPIMAPI" {
name = "cloudquickpocsapim-api"
resource_group_name = azurerm_resource_group.CloudQuickPOCAPIMRG.name
api_management_name = azurerm_api_management.CloudQuickPOCAPIM.name
revision = "1"
display_name = "CloudQuickPOCsFirstAPI"
resource "azurerm_api_management_api" "api" {
resource_group_name = var.context.resource_group_name
api_management_name = var.service_settings.endpoint_name
Parameters
-
api_management_name
required - string -
description
optional - string -
display_name
required - string -
id
optional computed - string -
is_current
optional computed - bool -
is_online
optional computed - bool -
name
required - string -
path
required - string -
protocols
required - set of string -
resource_group_name
required - string -
revision
required - string -
service_url
optional computed - string -
soap_pass_through
optional - bool -
subscription_required
optional - bool -
version
optional computed - string -
version_set_id
optional computed - string -
import
list block-
content_format
required - string -
content_value
required - string -
wsdl_selector
list block-
endpoint_name
required - string -
service_name
required - string
-
-
-
oauth2_authorization
list block-
authorization_server_name
required - string -
scope
optional - string
-
-
openid_authentication
list block-
bearer_token_sending_methods
optional - set of string -
openid_provider_name
required - string
-
-
subscription_key_parameter_names
list block -
timeouts
single block
Explanation in Terraform Registry
Manages an API within an API Management Service.
Microsoft.ApiManagement/service/apis (Azure Resource Manager)
The service/apis in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/apis
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringname
required - stringAPI revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
properties
requiredapiRevision
optional - stringDescribes the revision of the API. If no value is provided, default revision 1 is created
apiRevisionDescription
optional - stringDescription of the API Revision.
apiType
optional - stringType of API to create.
http
creates a REST APIsoap
creates a SOAP pass-through APIwebsocket
creates websocket APIgraphql
creates GraphQL API.
apiVersion
optional - stringIndicates the version identifier of the API if the API is versioned
apiVersionDescription
optional - stringDescription of the API Version.
apiVersionSet
optionaldescription
optional - stringDescription of API Version Set.
id
optional - stringIdentifier for existing API Version Set. Omit this value to create a new Version Set.
name
optional - stringThe display Name of the API Version Set.
versionHeaderName
optional - stringName of HTTP header parameter that indicates the API Version if versioningScheme is set to
header
.versioningScheme
optional - stringAn value that determines where the API Version identifier will be located in a HTTP request.
versionQueryName
optional - stringName of query parameter that indicates the API Version if versioningScheme is set to
query
.
apiVersionSetId
optional - stringA resource identifier for the related ApiVersionSet.
authenticationSettings
optionaloAuth2
optionalauthorizationServerId
optional - stringOAuth authorization server identifier.
scope
optional - stringoperations scope.
openid
optionalbearerTokenSendingMethods
optional - arrayHow to send token to the server.
openidProviderId
optional - stringOAuth authorization server identifier.
contact
optionalemail
optional - stringThe email address of the contact person/organization. MUST be in the format of an email address
name
optional - stringThe identifying name of the contact person/organization
url
optional - stringThe URL pointing to the contact information. MUST be in the format of a URL
description
optional - stringDescription of the API. May include HTML formatting tags.
displayName
optional - stringAPI name. Must be 1 to 300 characters long.
format
optional - stringFormat of the Content in which the API is getting imported.
isCurrent
optional - booleanIndicates if API revision is current api revision.
license
optionalname
optional - stringThe license name used for the API
url
optional - stringA URL to the license used for the API. MUST be in the format of a URL
path
required - stringRelative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
protocols
optional - arrayDescribes on which protocols the operations in this API can be invoked.
serviceUrl
optional - stringAbsolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
sourceApiId
optional - stringAPI identifier of the source API.
subscriptionKeyParameterNames
optionalheader
optional - stringSubscription key header name.
query
optional - stringSubscription key query string parameter name.
subscriptionRequired
optional - booleanSpecifies whether an API or Product subscription is required for accessing the API.
termsOfServiceUrl
optional - stringA URL to the Terms of Service for the API. MUST be in the format of a URL.
type
optional - stringType of API.
value
optional - stringContent value when Importing an API.
wsdlSelector
optionalwsdlEndpointName
optional - stringName of endpoint(port) to import from WSDL
wsdlServiceName
optional - stringName of service to import from WSDL
type
required - string
Frequently asked questions
What is Azure API Management API?
Azure API Management API is a resource for API Management of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure API Management API?
For Terraform, the badgerowluke/whitewaterfinder, pagopa/pagopa-infra and 0GiS0/az-api-management-devops source code examples are useful. See the Terraform Example section for further details.