Skip to content

azurermApiManagementBackend

Manages a backend within an API Management Service.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermApiManagementExample = new azurerm.apiManagement.ApiManagement(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-apim",
    publisher_email: "company@terraform.io",
    publisher_name: "My Company",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Developer_1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementExample.overrideLogicalId("example");
const azurermApiManagementBackendExample =
  new azurerm.apiManagementBackend.ApiManagementBackend(this, "example_2", {
    api_management_name: azurermApiManagementExample.name,
    name: "example-backend",
    protocol: "http",
    resource_group_name: azurermResourceGroupExample.name,
    url: "https://backend",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementBackendExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the API Management backend. Changing this forces a new resource to be created.

  • apiManagementName - (Required) The Name of the API Management Service where this backend should be created. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

  • protocol - (Required) The protocol used by the backend host. Possible values are http or soap.

  • url - (Required) The URL of the backend host.


  • credentials - (Optional) A credentials block as documented below.

  • description - (Optional) The description of the backend.

  • proxy - (Optional) A proxy block as documented below.

  • resourceId - (Optional) The management URI of the backend host in an external system. This URI can be the ARM Resource ID of Logic Apps, Function Apps or API Apps, or the management endpoint of a Service Fabric cluster.

  • serviceFabricCluster - (Optional) A serviceFabricCluster block as documented below.

  • title - (Optional) The title of the backend.

  • tls - (Optional) A tls block as documented below.


A credentials block supports the following:

  • authorization - (Optional) An authorization block as defined below.

  • certificate - (Optional) A list of client certificate thumbprints to present to the backend host. The certificates must exist within the API Management Service.

  • header - (Optional) A mapping of header parameters to pass to the backend host. The keys are the header names and the values are a comma separated string of header values. This is converted to a list before being passed to the API.

  • query - (Optional) A mapping of query parameters to pass to the backend host. The keys are the query names and the values are a comma separated string of query values. This is converted to a list before being passed to the API.


An authorization block supports the following:

  • parameter - (Optional) The authentication Parameter value.

  • scheme - (Optional) The authentication Scheme name.


A proxy block supports the following:

  • password - (Optional) The password to connect to the proxy server.

  • url - (Required) The URL of the proxy server.

  • username - (Required) The username to connect to the proxy server.


A serviceFabricCluster block supports the following:

  • clientCertificateThumbprint - (Optional) The client certificate thumbprint for the management endpoint.

  • clientCertificateId - (Optional) The client certificate resource id for the management endpoint.

Note: At least one of clientCertificateThumbprint, and clientCertificateId must be set.

  • managementEndpoints - (Required) A list of cluster management endpoints.

  • maxPartitionResolutionRetries - (Required) The maximum number of retries when attempting resolve the partition.

  • serverCertificateThumbprints - (Optional) A list of thumbprints of the server certificates of the Service Fabric cluster.

  • serverX509Name - (Optional) One or more serverX509Name blocks as documented below.


A serverX509Name block supports the following:

  • issuerCertificateThumbprint - (Required) The thumbprint for the issuer of the certificate.

  • name - (Required) The common name of the certificate.


A tls block supports the following:

  • validateCertificateChain - (Optional) Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for the backend host.

  • validateCertificateName - (Optional) Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for the backend host.


Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the API Management API.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the API Management Backend.
  • update - (Defaults to 30 minutes) Used when updating the API Management Backend.
  • read - (Defaults to 5 minutes) Used when retrieving the API Management Backend.
  • delete - (Defaults to 30 minutes) Used when deleting the API Management Backend.

Import

API Management backends can be imported using the resourceId, e.g.

terraform import azurerm_api_management_backend.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/backends/backend1