Skip to content

azurermApiManagementProduct

Manages an API Management 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 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 azurermApiManagementProductExample =
  new azurerm.apiManagementProduct.ApiManagementProduct(this, "example_2", {
    api_management_name: azurermApiManagementExample.name,
    approval_required: true,
    display_name: "Test Product",
    product_id: "test-product",
    published: true,
    resource_group_name: azurermResourceGroupExample.name,
    subscription_required: true,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementProductExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

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

  • approvalRequired - (Optional) Do subscribers need to be approved prior to being able to use the Product?

-> NOTE: approvalRequired can only be set when subscriptionRequired is set to true.

  • displayName - (Required) The Display Name for this API Management Product.

  • productId - (Required) The Identifier for this Product, which must be unique within the API Management Service. Changing this forces a new resource to be created.

  • published - (Required) Is this Product Published?

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

  • subscriptionRequired - (Optional) Is a Subscription required to access API's included in this Product? Defaults to true.


  • description - (Optional) A description of this Product, which may include HTML formatting tags.

  • subscriptionsLimit - (Optional) The number of subscriptions a user can have to this Product at the same time.

-> NOTE: subscriptionsLimit can only be set when subscriptionRequired is set to true.

  • terms - (Optional) The Terms and Conditions for this Product, which must be accepted by Developers before they can begin the Subscription process.

Attributes Reference

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

  • id - The ID of the API Management Product.

Timeouts

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

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

Import

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

terraform import azurerm_api_management_product.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/products/myproduct