Skip to content

Commit

Permalink
update the privatelink doc with Azure example (#509)
Browse files Browse the repository at this point in the history
* update the prvivatelink doc with Azure example and formatted the configuration

* fix typo error in data

Co-authored-by: Nikhil Singh <[email protected]>
  • Loading branch information
nikhil-mongo and Nikhil Singh authored Aug 11, 2021
1 parent 9e55f51 commit 0b26ebe
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 9 deletions.
48 changes: 43 additions & 5 deletions website/docs/d/privatelink_endpoint_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: |-

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

## Example Usage
## Example with AWS

```hcl
resource "mongodbatlas_privatelink_endpoint" "test" {
Expand All @@ -30,10 +30,48 @@ resource "aws_vpc_endpoint" "ptfe_service" {
}
resource "mongodbatlas_privatelink_endpoint_service" "test" {
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
provider_name ="AWS"
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
provider_name = "AWS"
}
data "mongodbatlas_privatelink_endpoint_service" "test" {
project_id = mongodbatlas_privatelink_endpoint_service.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint_service.test.private_link_id
interface_endpoint_id = mongodbatlas_privatelink_endpoint_service.test.interface_endpoint_id
}
```

## Example with Azure

```hcl
resource "mongodbatlas_privatelink_endpoint" "test" {
project_id = var.project_id
provider_name = "AZURE"
region = "eastus2"
}
resource "azurerm_private_endpoint" "test" {
name = "endpoint-test"
location = data.azurerm_resource_group.test.location
resource_group_name = var.resource_group_name
subnet_id = azurerm_subnet.test.id
private_service_connection {
name = mongodbatlas_privatelink_endpoint.test.private_link_service_name
private_connection_resource_id = mongodbatlas_privatelink_endpoint.test.private_link_service_resource_id
is_manual_connection = true
request_message = "Azure Private Link test"
}
}
resource "mongodbatlas_privatelink_endpoint_service" "test" {
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
endpoint_service_id = azurerm_private_endpoint.test.id
private_endpoint_ip_address = azurerm_private_endpoint.test.private_service_connection.0.private_ip_address
provider_name = "AZURE"
}
data "mongodbatlas_privatelink_endpoint_service" "test" {
Expand Down
40 changes: 36 additions & 4 deletions website/docs/r/privatelink_endpoint_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: |-
-> **NOTE:** Groups and projects are synonymous terms. You may find group_id in the official documentation.


## Example Usage
## Example with AWS

```hcl
resource "mongodbatlas_privatelink_endpoint" "test" {
Expand All @@ -35,10 +35,42 @@ resource "aws_vpc_endpoint" "ptfe_service" {
}
resource "mongodbatlas_privatelink_endpoint_service" "test" {
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
provider_name = "AWS"
provider_name = "AWS"
}
```

## Example with Azure

```hcl
resource "mongodbatlas_privatelink_endpoint" "test" {
project_id = var.project_id
provider_name = "AZURE"
region = "eastus2"
}
resource "azurerm_private_endpoint" "test" {
name = "endpoint-test"
location = data.azurerm_resource_group.test.location
resource_group_name = var.resource_group_name
subnet_id = azurerm_subnet.test.id
private_service_connection {
name = mongodbatlas_privatelink_endpoint.test.private_link_service_name
private_connection_resource_id = mongodbatlas_privatelink_endpoint.test.private_link_service_resource_id
is_manual_connection = true
request_message = "Azure Private Link test"
}
}
resource "mongodbatlas_privatelink_endpoint_service" "test" {
project_id = mongodbatlas_privatelink_endpoint.test.project_id
private_link_id = mongodbatlas_privatelink_endpoint.test.private_link_id
endpoint_service_id = azurerm_private_endpoint.test.id
private_endpoint_ip_address = azurerm_private_endpoint.test.private_service_connection.0.private_ip_address
provider_name = "AZURE"
}
```

Expand Down

0 comments on commit 0b26ebe

Please sign in to comment.