Skip to content

azurermApiManagementProductApi

Manages an API Management API Assignment to a Product.

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 dataAzurermApiManagementExample =
  new azurerm.dataAzurermApiManagement.DataAzurermApiManagement(
    this,
    "example",
    {
      name: "example-api",
      resource_group_name: "example-resources",
    }
  );
const dataAzurermApiManagementApiExample =
  new azurerm.dataAzurermApiManagementApi.DataAzurermApiManagementApi(
    this,
    "example_1",
    {
      api_management_name: dataAzurermApiManagementExample.name,
      name: "search-api",
      resource_group_name: dataAzurermApiManagementExample.resourceGroupName,
      revision: "2",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermApiManagementApiExample.overrideLogicalId("example");
const dataAzurermApiManagementProductExample =
  new azurerm.dataAzurermApiManagementProduct.DataAzurermApiManagementProduct(
    this,
    "example_2",
    {
      api_management_name: dataAzurermApiManagementExample.name,
      product_id: "my-product",
      resource_group_name: dataAzurermApiManagementExample.resourceGroupName,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermApiManagementProductExample.overrideLogicalId("example");
const azurermApiManagementProductApiExample =
  new azurerm.apiManagementProductApi.ApiManagementProductApi(
    this,
    "example_3",
    {
      api_management_name: dataAzurermApiManagementExample.name,
      api_name: dataAzurermApiManagementApiExample.name,
      product_id: dataAzurermApiManagementProductExample.productId,
      resource_group_name: dataAzurermApiManagementExample.resourceGroupName,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementProductApiExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • apiName - (Required) The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.

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

  • productId - (Required) The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.

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

Attributes Reference

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

  • id - The ID of the API Management Product API.

Timeouts

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

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

Import

API Management Product API's can be imported using the resourceId, e.g.

terraform import azurerm_api_management_product_api.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/products/exampleId/apis/apiId