azurerm_api_connection

Manages an API Connection.

Example Usage

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

data "azurerm_managed_api" "example" {
  name     = "servicebus"
  location = azurerm_resource_group.example.location
}

resource "azurerm_servicebus_namespace" "example" {
  name                = "acctestsbn-conn-example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Basic"
}

resource "azurerm_api_connection" "example" {
  name                = "example-connection"
  resource_group_name = azurerm_resource_group.example.name
  managed_api_id      = data.azurerm_managed_api.example.id
  display_name        = "Example 1"

  parameter_values = {
    connectionString = azurerm_servicebus_namespace.example.default_primary_connection_string
  }

  tags = {
    Hello = "World"
  }

  lifecycle {
    # NOTE: since the connectionString is a secure value it's not returned from the API
    ignore_changes = ["parameter_values"]
  }
}

Arguments Reference

The following arguments are supported:


Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

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

Import

API Connections can be imported using the resource id, e.g.

terraform import azurerm_api_connection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.Web/connections/example-connection