Skip to content

azurermWebPubsubSharedPrivateLinkResource

Manages the Shared Private Link Resource for a Web Pubsub 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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "east us",
    name: "terraform-webpubsub",
  }
);
const azurermWebPubsubExample = new azurerm.webPubsub.WebPubsub(
  this,
  "example_1",
  {
    capacity: 1,
    location: azurermResourceGroupExample.location,
    name: "tfex-webpubsub",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard_S1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermWebPubsubExample.overrideLogicalId("example");
const dataAzurermClientConfigCurrent =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "current",
    {}
  );
const azurermKeyVaultExample = new azurerm.keyVault.KeyVault(
  this,
  "example_3",
  {
    access_policy: [
      {
        certificate_permissions: ["managecontacts"],
        key_permissions: ["create"],
        object_id: dataAzurermClientConfigCurrent.objectId,
        secret_permissions: ["set"],
        tenant_id: dataAzurermClientConfigCurrent.tenantId,
      },
    ],
    location: azurermResourceGroupExample.location,
    name: "examplekeyvault",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "standard",
    soft_delete_retention_days: 7,
    tenant_id: dataAzurermClientConfigCurrent.tenantId,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKeyVaultExample.overrideLogicalId("example");
const azurermWebPubsubSharedPrivateLinkResourceExample =
  new azurerm.webPubsubSharedPrivateLinkResource.WebPubsubSharedPrivateLinkResource(
    this,
    "example_4",
    {
      name: "tfex-webpubsub-splr",
      subresource_name: "vault",
      target_resource_id: azurermKeyVaultExample.id,
      web_pubsub_id: azurermWebPubsubExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermWebPubsubSharedPrivateLinkResourceExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specify the name of the Web Pubsub Shared Private Link Resource. Changing this forces a new resource to be created.

  • webPubsubId - (Required) Specify the id of the Web Pubsub. Changing this forces a new resource to be created.

  • subresourceName - (Required) Specify the sub resource name which the Web Pubsub Private Endpoint is able to connect to. Changing this forces a new resource to be created.

-> NOTE: The available sub resource can be retrieved by using azurermWebPubsubPrivateLinkResource data source.

  • targetResourceId - (Required) Specify the ID of the Shared Private Link Enabled Remote Resource which this Web Pubsub Private Endpoint should be connected to. Changing this forces a new resource to be created.

-> NOTE: The sub resource name should match with the type of the target resource id that's being specified.

  • requestMessage - (Optional) Specify the request message for requesting approval of the Shared Private Link Enabled Remote Resource.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Web Pubsub Shared Private Link resource.

  • status - The status of a private endpoint connection. Possible values are Pending, Approved, Rejected or Disconnected.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Web Pubsub Shared Private Link Resource.
  • update - (Defaults to 30 minutes) Used when updating the Web Pubsub Shared Private Link Resource.
  • read - (Defaults to 5 minutes) Used when retrieving the Web Pubsub Shared Private Link Resource.
  • delete - (Defaults to 30 minutes) Used when deleting the Web Pubsub Shared Private Link Resource.

Import

Web Pubsub Shared Private Link Resource can be imported using the resourceId, e.g.

terraform import azurerm_web_pubsub_shared_private_link_resource.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SignalRService/webPubSub/webPubSub1/sharedPrivateLinkResources/resource1