gpt4 book ai didi

azure - 我应该如何知道不同 Azure 服务的有效 subresource_names 以便为它们设置专用链接?

转载 作者:行者123 更新时间:2023-12-03 06:38:09 28 4
gpt4 key购买 nike

我正在关注this document为不同的资源(keyvaultDatabricksDataFactorymssql 数据库)创建私有(private)链接。 p>

resource "azurerm_private_endpoint" "endpoint" {
name = format("%s-%s", var.name, "private-endpoint")
location = var.resource_group_location
resource_group_name = var.resource_group_name
subnet_id = var.subnet_id

private_service_connection {
name = format("%s-%s", var.name, "private-service-connection")
private_connection_resource_id = var.private_link_enabled_resource_id
is_manual_connection = false
subresource_names = var.subresource_names
}
}

resource "azurerm_private_dns_a_record" "dns_a" {
name = var.asset_name_which_use_endpoint
zone_name = var.zone_name
resource_group_name = var.resource_group_name
ttl = 10
records = [azurerm_private_endpoint.endpoint.private_service_connection.0.private_ip_address]
}

如您所见,我必须填写每个资源所需的 subresource_names 值。但是,我不知道正确的值是多少?

我查过this pagethis page但仍然不知道有效值。

所以,我的问题是,keyvaultDatabricksDataFactory 的有效 subresource_names 值是多少和mssql数据库

最佳答案

下面的教程已经定义了私有(private)链接的子资源; “子资源”中的关键字取决于您要连接的资源类型。 link , Databrick

keyvaultDatabricksDataFactorymssql 数据库的有效 subresource_names 值是多少

答案:

在下面找到您正在查找的子资源列表。

  • mssql - sqlServer
  • Databrick - databricks_ui_api
  • 数据工厂 - 数据工厂
  • keyvault - 金库

使用 SQL Server 和数据 block 复制示例代码库,查找以下源代码以供引用

**注意:连接第三方资源时会出现与 GroupId 相关的错误。引用代码库来自 HashiCorpsite

data  "azurerm_client_config"  "current" {}
resource "azurerm_resource_group" "example" {
name = "v-swarna-mindtree"
location = "West Europe"
}
resource "azurerm_sql_server" "example" {
name = "myexamplesqlservernew"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
version = "12.0"
administrator_login = "******"
administrator_login_password = "******"
tags = {
environment = "production"
}
}

resource "azurerm_sql_database" "example" {
name = "myexamplesqldatabase"
resource_group_name = azurerm_resource_group.example.name

location = azurerm_resource_group.example.location
server_name = azurerm_sql_server.example.name

}

resource "azurerm_databricks_workspace" "example" {

name = "databrickstest"

resource_group_name = azurerm_resource_group.example.name

location = azurerm_resource_group.example.location

sku = "standard"



tags = {

Environment = "Production"

}

}

resource "azurerm_virtual_network" "example" {

name = "example-network"

address_space = ["10.0.0.0/16"]

location = azurerm_resource_group.example.location

resource_group_name = azurerm_resource_group.example.name

}

resource "azurerm_subnet" "service" {
name = "service"
resource_group_name = azurerm_resource_group.example.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.1.0/24"]
enforce_private_link_service_network_policies = true
}
resource "azurerm_subnet" "endpoint" {
name = "endpoint"
resource_group_name = azurerm_resource_group.example.name

virtual_network_name = azurerm_virtual_network.example.name

address_prefixes = ["10.0.2.0/24"]



enforce_private_link_endpoint_network_policies = true

}

resource "azurerm_public_ip" "example" {
name = "example-pip"
sku = "Standard"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
allocation_method = "Static"
}

resource "azurerm_lb" "example" {
name = "example-lb"
sku = "Standard"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name

frontend_ip_configuration {
name = azurerm_public_ip.example.name
public_ip_address_id = azurerm_public_ip.example.id
}
}
resource "azurerm_private_link_service" "example" {
name = "example-privatelink"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
nat_ip_configuration {
name = azurerm_public_ip.example.name
primary = true
subnet_id = azurerm_subnet.service.id
}

load_balancer_frontend_ip_configuration_ids = [
azurerm_lb.example.frontend_ip_configuration.0.id,
]
}

resource "azurerm_private_endpoint" "example" {
name = "example-endpoint"
location = azurerm_resource_group.example.location
resource_group_name = azur
subnet_id = azurerm_subnet
private_service_connection {
name = "example-privateserviceconnection"
private_connection_resource_id = "/subscriptions/********************/resourceGroups/*******/providers/Microsoft.Network/privateLinkServices/example-privatelink" //azurerm_private_link_service.example.id
is_manual_connection = false
subresource_names = ["databricks_ui_api"]
}
}
resource "azurerm_private_dns_zone" "example" {
name = "****.com"
resource_group_name = azurerm_resource_group.example.name
}
resource "azurerm_private_dns_a_record" "dns_a" {
name = "dnsprivate"
zone_name = azurerm_private_dns_zone.example.name
resource_group_name = azurerm_resource_group.example.name
ttl = 10
records = [azurerm_private_endpoint.example.private_service_connection.0.private_ip_address]
}

地形规划如下:

enter image description here

申请后验证 enter image description here

关于azure - 我应该如何知道不同 Azure 服务的有效 subresource_names 以便为它们设置专用链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74722864/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com