Skip to content

azurermApiManagementUser

Manages an API Management User.

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 azurermApiManagementUserExample =
  new azurerm.apiManagementUser.ApiManagementUser(this, "example_2", {
    api_management_name: azurermApiManagementExample.name,
    email: "tom+tfdev@hashicorp.com",
    first_name: "Example",
    last_name: "User",
    resource_group_name: azurermResourceGroupExample.name,
    state: "active",
    user_id: "5931a75ae4bbd512288c680b",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementUserExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • apiManagementName - (Required) The name of the API Management Service in which the User should be created. 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.

  • email - (Required) The email address associated with this user.

  • firstName - (Required) The first name for this user.

  • lastName - (Required) The last name for this user.

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


  • confirmation - (Optional) The kind of confirmation email which will be sent to this user. Possible values are invite and signup. Changing this forces a new resource to be created.

  • note - (Optional) A note about this user.

  • password - (Optional) The password associated with this user.

  • state - (Optional) The state of this user. Possible values are active, blocked and pending.

-> NOTE: the State can be changed from Pending -> Active/Blocked but not from Active/Blocked -> Pending.

Attributes Reference

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

  • id - The ID of the API Management User.

Timeouts

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

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

Import

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

terraform import azurerm_api_management_user.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/users/abc123