Skip to content

A module used to deploy a private endpoint resource with some handy defaults ๐Ÿ“ถ๐Ÿ”’

License

Notifications You must be signed in to change notification settings

cyber-scot/terraform-azurerm-private-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

resource "azurerm_private_endpoint" "endpoint" {
  for_each = { for v in var.private_endpoints : v.name => v }

  name                          = each.value.name
  location                      = each.value.location
  resource_group_name           = each.value.rg_name
  subnet_id                     = each.value.subnet_id
  custom_network_interface_name = each.value.custom_network_interface_name
  tags                          = each.value.tags

  dynamic "private_service_connection" {
    for_each = each.value.private_service_connection != null ? [each.value.private_service_connection] : []
    content {
      name                              = private_service_connection.value.name
      is_manual_connection              = private_service_connection.value.is_manual_connection
      private_connection_resource_id    = private_service_connection.value.private_connection_resource_id
      private_connection_resource_alias = private_service_connection.value.private_connection_resource_alias
      subresource_names                 = private_service_connection.value.subresource_names
      request_message                   = private_service_connection.value.is_manual_connection == true ? private_service_connection.value.request_message : null
    }
  }

  dynamic "private_dns_zone_group" {
    for_each = each.value.private_dns_zone_group != null ? [each.value.private_dns_zone_group] : []
    content {
      name                 = private_dns_zone_group.value.name
      private_dns_zone_ids = private_dns_zone_group.value.private_dns_zone_ids
    }
  }

  dynamic "ip_configuration" {
    for_each = each.value.ip_configuration != null ? [each.value.ip_configuration] : []
    content {
      name               = ip_configuration.value.name
      private_ip_address = ip_configuration.value.private_ip_address
      subresource_name   = ip_configuration.value.subresource_name
      member_name        = ip_configuration.value.member_name
    }
  }
}

Requirements

No requirements.

Providers

Name Version
azurerm n/a

Modules

No modules.

Resources

Name Type
azurerm_private_endpoint.endpoint resource

Inputs

Name Description Type Default Required
private_endpoints n/a
list(object({
name = string
location = string
rg_name = string
subnet_id = string
custom_network_interface_name = optional(string)
tags = optional(map(string))
private_service_connection = optional(object({
name = string
is_manual_connection = optional(bool)
private_connection_resource_id = optional(string)
private_connection_resource_alias = optional(string)
subresource_names = optional(list(string))
request_message = optional(string)
}))
private_dns_zone_group = optional(object({
name = string
private_dns_zone_ids = optional(list(string))
}))
ip_configuration = optional(object({
name = string
private_ip_address = optional(string)
subresource_name = optional(list(string))
member_name = optional(string)
}))
}))
[] no
sub_resource_names The sub resource names of private endpoints found at https://learn.microsoft.com/en-gb/azure/private-link/private-endpoint-overview#private-link-resource, not used, but provided for lookup option map(string)
{
"Microsoft.Appconfiguration/configurationStores": "configurationStores",
"Microsoft.Authorization/resourceManagementPrivateLinks": "ResourceManagement",
"Microsoft.Automation/automationAccounts": "Webhook, DSCAndHybridWorker",
"Microsoft.AzureCosmosDB/databaseAccounts": "SQL, MongoDB, Cassandra, Gremlin, Table",
"Microsoft.Batch/batchAccounts": "batchAccount, nodeManagement",
"Microsoft.Cache/Redis": "redisCache",
"Microsoft.Cache/redisEnterprise": "redisEnterprise",
"Microsoft.CognitiveServices/accounts": "account",
"Microsoft.Compute/diskAccesses": "managed disk",
"Microsoft.ContainerRegistry/registries": "registry",
"Microsoft.ContainerService/managedClusters": "management",
"Microsoft.DBforMariaDB/servers": "mariadbServer",
"Microsoft.DBforMySQL/servers": "mysqlServer",
"Microsoft.DBforPostgreSQL/servers": "postgresqlServer",
"Microsoft.DataFactory/factories": "dataFactory",
"Microsoft.Databricks/workspaces": "databricks_ui_api, browser_authentication",
"Microsoft.Devices/IotHubs": "iotHub",
"Microsoft.Devices/provisioningServices": "iotDps",
"Microsoft.DigitalTwins/digitalTwinsInstances": "API",
"Microsoft.EventGrid/domains": "domain",
"Microsoft.EventGrid/topics": "topic",
"Microsoft.EventHub/namespaces": "namespace",
"Microsoft.HDInsight/clusters": "cluster",
"Microsoft.HealthcareApis/services": "fhir",
"Microsoft.Insights/privatelinkscopes": "azuremonitor",
"Microsoft.IoTCentral/IoTApps": "IoTApps",
"Microsoft.KeyVault/vaults": "vault",
"Microsoft.Keyvault/managedHSMs": "HSM",
"Microsoft.Kusto/clusters": "cluster",
"Microsoft.MachineLearningServices/workspaces": "amlworkspace",
"Microsoft.Media/mediaservices": "keydelivery, liveevent, streamingendpoint",
"Microsoft.Migrate/assessmentProjects": "project",
"Microsoft.Network/applicationgateways": "application gateway",
"Microsoft.Network/privateLinkServices": "empty",
"Microsoft.PowerBI/privateLinkServicesForPowerBI": "Power BI",
"Microsoft.Purview/accounts": "account, portal",
"Microsoft.RecoveryServices/vaults": "AzureBackup, AzureSiteRecovery",
"Microsoft.Relay/namespaces": "namespace",
"Microsoft.Search/searchServices": "searchService",
"Microsoft.ServiceBus/namespaces": "namespace",
"Microsoft.SignalRService/SignalR": "signalr",
"Microsoft.SignalRService/webPubSub": "webpubsub",
"Microsoft.Sql/servers": "sqlServer",
"Microsoft.Storage/storageAccounts": "blob, blob_secondary, table, table_secondary, queue, queue_secondary, file, file_secondary, web, web_secondary, dfs, dfs_secondary",
"Microsoft.StorageSync/storageSyncServices": "File Sync Service",
"Microsoft.Synapse/privateLinkHubs": "web",
"Microsoft.Synapse/workspaces": "Sql, SqlOnDemand, Dev",
"Microsoft.Web/hostingEnvironments": "hosting environment",
"Microsoft.Web/sites": "sites",
"Microsoft.Web/staticSites": "staticSites"
}
no

Outputs

Name Description
custom_dns_configs The custom DNS configurations of the private endpoints.
endpoint_ids The IDs of the Private Endpoints.
ip_configurations A map of IP configurations for each private endpoint, keyed by the private endpoint name.
network_interfaces The network interfaces associated with the private endpoints.
private_dns_zone_configs n/a
private_service_connections The private service connections of the private endpoints.
record_sets n/a