-
Notifications
You must be signed in to change notification settings - Fork 3
/
atlas-pl.tf
20 lines (18 loc) · 830 Bytes
/
atlas-pl.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
resource "mongodbatlas_privatelink_endpoint" "atlaspl" {
project_id = mongodbatlas_project.atlas-project.id
provider_name = "AWS"
region = var.aws_region
}
resource "aws_vpc_endpoint" "ptfe_service" {
vpc_id = aws_vpc.primary.id
service_name = mongodbatlas_privatelink_endpoint.atlaspl.endpoint_service_name
vpc_endpoint_type = "Interface"
subnet_ids = [aws_subnet.primary-az1.id, aws_subnet.primary-az2.id]
security_group_ids = [aws_security_group.primary_default.id]
}
resource "mongodbatlas_privatelink_endpoint_service" "atlaseplink" {
project_id = mongodbatlas_privatelink_endpoint.atlaspl.project_id
endpoint_service_id = aws_vpc_endpoint.ptfe_service.id
private_link_id = mongodbatlas_privatelink_endpoint.atlaspl.id
provider_name = "AWS"
}