Skip to content

azurermApiManagementApiVersionSet

Manages an API Version Set 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.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermApiManagementExample = new azurerm.apiManagement.ApiManagement(
  this,
  "example_2",
  {
    location: azurermResourceGroupExample.location,
    name: "example-apim",
    publisher_email: "pub1@email.com",
    publisher_name: "pub1",
    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 azurermApiManagementApiVersionSetExample =
  new azurerm.apiManagementApiVersionSet.ApiManagementApiVersionSet(
    this,
    "example_3",
    {
      api_management_name: azurermApiManagementExample.name,
      display_name: "ExampleAPIVersionSet",
      name: "example-apimapi-1_0_0",
      resource_group_name: azurermResourceGroupExample.name,
      versioning_scheme: "Segment",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementApiVersionSetExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the API Version Set. May only contain alphanumeric characters and dashes up to 80 characters in length. Changing this forces a new resource to be created.

  • apiManagementName - (Required) The name of the API Management Service in which the API Version Set should exist. May only contain alphanumeric characters and dashes up to 50 characters in length. Changing this forces a new resource to be created.

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

  • displayName - (Required) The display name of this API Version Set.

  • versioningScheme - (Required) Specifies where in an Inbound HTTP Request that the API Version should be read from. Possible values are header, query and segment.


  • description - (Optional) The description of API Version Set.

  • versionHeaderName - (Optional) The name of the Header which should be read from Inbound Requests which defines the API Version.

-> NOTE: This must be specified when versioningScheme is set to header.

  • versionQueryName - (Optional) The name of the Query String which should be read from Inbound Requests which defines the API Version.

-> NOTE: This must be specified when versioningScheme is set to query.

Attributes Reference

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

  • id - The ID of the API Version Set.

Timeouts

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

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

Import

API Version Set can be imported using the resourceId, e.g.

terraform import azurerm_api_management_api_version_set.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/apiVersionSets/set1