Skip to content

Commit 0b26ebe

Browse files
nikhil-mongoNikhil Singh
andauthored
update the privatelink doc with Azure example (#509)
* update the prvivatelink doc with Azure example and formatted the configuration * fix typo error in data Co-authored-by: Nikhil Singh <[email protected]>
1 parent 9e55f51 commit 0b26ebe

File tree

2 files changed

+79
-9
lines changed

2 files changed

+79
-9
lines changed

website/docs/d/privatelink_endpoint_service.html.markdown

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: |-
1212

1313
-> **NOTE:** Groups and projects are synonymous terms. You may find group_id in the official documentation.
1414

15-
## Example Usage
15+
## Example with AWS
1616

1717
```hcl
1818
resource "mongodbatlas_privatelink_endpoint" "test" {
@@ -30,10 +30,48 @@ resource "aws_vpc_endpoint" "ptfe_service" {
3030
}
3131
3232
resource "mongodbatlas_privatelink_endpoint_service" "test" {
33-
project_id = mongodbatlas_privatelink_endpoint.test.project_id
34-
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
35-
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
36-
provider_name ="AWS"
33+
project_id = mongodbatlas_privatelink_endpoint.test.project_id
34+
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
35+
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
36+
provider_name = "AWS"
37+
}
38+
39+
data "mongodbatlas_privatelink_endpoint_service" "test" {
40+
project_id = mongodbatlas_privatelink_endpoint_service.test.project_id
41+
private_link_id = mongodbatlas_privatelink_endpoint_service.test.private_link_id
42+
interface_endpoint_id = mongodbatlas_privatelink_endpoint_service.test.interface_endpoint_id
43+
}
44+
```
45+
46+
## Example with Azure
47+
48+
```hcl
49+
resource "mongodbatlas_privatelink_endpoint" "test" {
50+
project_id = var.project_id
51+
provider_name = "AZURE"
52+
region = "eastus2"
53+
}
54+
55+
resource "azurerm_private_endpoint" "test" {
56+
name = "endpoint-test"
57+
location = data.azurerm_resource_group.test.location
58+
resource_group_name = var.resource_group_name
59+
subnet_id = azurerm_subnet.test.id
60+
private_service_connection {
61+
name = mongodbatlas_privatelink_endpoint.test.private_link_service_name
62+
private_connection_resource_id = mongodbatlas_privatelink_endpoint.test.private_link_service_resource_id
63+
is_manual_connection = true
64+
request_message = "Azure Private Link test"
65+
}
66+
67+
}
68+
69+
resource "mongodbatlas_privatelink_endpoint_service" "test" {
70+
project_id = mongodbatlas_privatelink_endpoint.test.project_id
71+
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
72+
endpoint_service_id = azurerm_private_endpoint.test.id
73+
private_endpoint_ip_address = azurerm_private_endpoint.test.private_service_connection.0.private_ip_address
74+
provider_name = "AZURE"
3775
}
3876
3977
data "mongodbatlas_privatelink_endpoint_service" "test" {

website/docs/r/privatelink_endpoint_service.html.markdown

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: |-
1717
-> **NOTE:** Groups and projects are synonymous terms. You may find group_id in the official documentation.
1818

1919

20-
## Example Usage
20+
## Example with AWS
2121

2222
```hcl
2323
resource "mongodbatlas_privatelink_endpoint" "test" {
@@ -35,10 +35,42 @@ resource "aws_vpc_endpoint" "ptfe_service" {
3535
}
3636
3737
resource "mongodbatlas_privatelink_endpoint_service" "test" {
38-
project_id = mongodbatlas_privatelink_endpoint.test.project_id
39-
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
38+
project_id = mongodbatlas_privatelink_endpoint.test.project_id
39+
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
4040
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
41-
provider_name = "AWS"
41+
provider_name = "AWS"
42+
}
43+
```
44+
45+
## Example with Azure
46+
47+
```hcl
48+
resource "mongodbatlas_privatelink_endpoint" "test" {
49+
project_id = var.project_id
50+
provider_name = "AZURE"
51+
region = "eastus2"
52+
}
53+
54+
resource "azurerm_private_endpoint" "test" {
55+
name = "endpoint-test"
56+
location = data.azurerm_resource_group.test.location
57+
resource_group_name = var.resource_group_name
58+
subnet_id = azurerm_subnet.test.id
59+
private_service_connection {
60+
name = mongodbatlas_privatelink_endpoint.test.private_link_service_name
61+
private_connection_resource_id = mongodbatlas_privatelink_endpoint.test.private_link_service_resource_id
62+
is_manual_connection = true
63+
request_message = "Azure Private Link test"
64+
}
65+
66+
}
67+
68+
resource "mongodbatlas_privatelink_endpoint_service" "test" {
69+
project_id = mongodbatlas_privatelink_endpoint.test.project_id
70+
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
71+
endpoint_service_id = azurerm_private_endpoint.test.id
72+
private_endpoint_ip_address = azurerm_private_endpoint.test.private_service_connection.0.private_ip_address
73+
provider_name = "AZURE"
4274
}
4375
```
4476

0 commit comments

Comments
 (0)