Skip to content

azurermRelayHybridConnection

Manages an Azure Relay Hybrid Connection.

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 azurermRelayNamespaceExample = new azurerm.relayNamespace.RelayNamespace(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-relay",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Standard",
    tags: {
      source: "terraform",
    },
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRelayNamespaceExample.overrideLogicalId("example");
const azurermRelayHybridConnectionExample =
  new azurerm.relayHybridConnection.RelayHybridConnection(this, "example_2", {
    name: "acctestrnhc-%d",
    relay_namespace_name: azurermRelayNamespaceExample.name,
    requires_client_authorization: false,
    resource_group_name: azurermResourceGroupExample.name,
    user_metadata: "testmetadata",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRelayHybridConnectionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.

  • relayNamespaceName - (Required) The name of the Azure Relay in which to create the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.

  • requiresClientAuthorization - (Optional) Specify if client authorization is needed for this hybrid connection. True by default. Changing this forces a new resource to be created. Defaults to true.

  • userMetadata - (Optional) The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Relay Hybrid Connection.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Relay Hybrid Connection.
  • update - (Defaults to 30 minutes) Used when updating the Relay Hybrid Connection.
  • read - (Defaults to 5 minutes) Used when retrieving the Relay Hybrid Connection.
  • delete - (Defaults to 30 minutes) Used when deleting the Relay Hybrid Connection.

Import

Relay Hybrid Connection's can be imported using the resourceId, e.g.

terraform import azurerm_relay_hybrid_connection.relay1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Relay/namespaces/relay1/hybridConnections/hconn1