-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INTMDB-214: Deprecation of private endpoint (#484)
* deleted deprecated resource, datasource and docs of private endpoint * added upgrade guide for deprecation private endpoint * changed name of resource * added terratest for deprecation private endpoint and import with privatelink endpoint * added comments Co-authored-by: Edgar López <[email protected]>
- Loading branch information
Showing
23 changed files
with
304 additions
and
1,429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
resource "mongodbatlas_private_endpoint" "atlaspl" { | ||
resource "mongodbatlas_privatelink_endpoint" "atlaspl" { | ||
project_id = var.atlasprojectid | ||
provider_name = "AWS" | ||
region = var.aws_region | ||
} | ||
|
||
resource "aws_vpc_endpoint" "ptfe_service" { | ||
vpc_id = aws_vpc.primary.id | ||
service_name = mongodbatlas_private_endpoint.atlaspl.endpoint_service_name | ||
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_private_endpoint_interface_link" "atlaseplink" { | ||
project_id = mongodbatlas_private_endpoint.atlaspl.project_id | ||
private_link_id = mongodbatlas_private_endpoint.atlaspl.private_link_id | ||
resource "mongodbatlas_privatelink_endpoint_service" "atlaseplink" { | ||
project_id = mongodbatlas_privatelink_endpoint.atlaspl.project_id | ||
private_link_id = mongodbatlas_privatelink_endpoint.atlaspl.private_link_id | ||
interface_endpoint_id = aws_vpc_endpoint.ptfe_service.id | ||
} |
44 changes: 44 additions & 0 deletions
44
examples/test-upgrade/v100/privatelink-endpoint/v091/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// This config will create aws endpoint, private endpoint and private endpoint interface | ||
// To verify that everything is working even after terraform plan and show not changes | ||
// and then do the import stuff in the folder for v100 | ||
|
||
resource "mongodbatlas_project" "test" { | ||
name = var.project_name | ||
org_id = var.org_id | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
access_key = var.aws_access_key | ||
secret_key = var.aws_secret_key | ||
} | ||
|
||
resource "mongodbatlas_private_endpoint" "test" { | ||
project_id = mongodbatlas_project.test.id | ||
provider_name = "AWS" | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_vpc_endpoint" "ptfe_service" { | ||
vpc_id = var.aws_vpc_id | ||
service_name = mongodbatlas_private_endpoint.test.endpoint_service_name | ||
vpc_endpoint_type = "Interface" | ||
subnet_ids = [var.aws_subnet_ids] | ||
security_group_ids = [var.aws_sg_ids] | ||
} | ||
|
||
resource "mongodbatlas_private_endpoint_interface_link" "test" { | ||
project_id = mongodbatlas_private_endpoint.test.project_id | ||
private_link_id = mongodbatlas_private_endpoint.test.private_link_id | ||
interface_endpoint_id = aws_vpc_endpoint.ptfe_service.id | ||
} | ||
|
||
output "project_id" { | ||
value = mongodbatlas_project.test.id | ||
} | ||
output "private_endpoint_id" { | ||
value = mongodbatlas_private_endpoint.test.private_link_id | ||
} | ||
output "vpc_endpoint_id" { | ||
value = aws_vpc_endpoint.ptfe_service.id | ||
} |
44 changes: 44 additions & 0 deletions
44
examples/test-upgrade/v100/privatelink-endpoint/v091/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
variable "public_key" { | ||
description = "The public API key for MongoDB Atlas" | ||
default = "" | ||
} | ||
variable "private_key" { | ||
description = "The private API key for MongoDB Atlas" | ||
default = "" | ||
} | ||
variable "project_name" { | ||
description = "Atlas project name" | ||
default = "" | ||
} | ||
variable "org_id" { | ||
description = "The organization ID" | ||
default = "" | ||
} | ||
variable "username" { | ||
description = "Username" | ||
default = "" | ||
} | ||
variable "role_name" { | ||
description = "The role name" | ||
default = "" | ||
} | ||
variable "aws_access_key" { | ||
description = "The access key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_secret_key" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_vpc_id" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_subnet_ids" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_sg_ids" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/test-upgrade/v100/privatelink-endpoint/v091/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
mongodbatlas = { | ||
source = "mongodb/mongodbatlas" | ||
version = "0.9.1" | ||
} | ||
} | ||
required_version = ">= 0.15" | ||
} |
34 changes: 34 additions & 0 deletions
34
examples/test-upgrade/v100/privatelink-endpoint/v100/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This is only for import stuff because it needs the resource names and set to | ||
// avoid changes when terraform plan | ||
|
||
resource "mongodbatlas_project" "test" { | ||
name = var.project_name | ||
org_id = var.org_id | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
access_key = var.aws_access_key | ||
secret_key = var.aws_secret_key | ||
} | ||
|
||
resource "mongodbatlas_privatelink_endpoint" "test" { | ||
project_id = mongodbatlas_project.test.id | ||
provider_name = "AWS" | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_vpc_endpoint" "ptfe_service" { | ||
vpc_id = var.aws_vpc_id | ||
service_name = mongodbatlas_privatelink_endpoint.test.endpoint_service_name | ||
vpc_endpoint_type = "Interface" | ||
subnet_ids = [var.aws_subnet_ids] | ||
security_group_ids = [var.aws_sg_ids] | ||
} | ||
|
||
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" | ||
} |
44 changes: 44 additions & 0 deletions
44
examples/test-upgrade/v100/privatelink-endpoint/v100/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
variable "public_key" { | ||
description = "The public API key for MongoDB Atlas" | ||
default = "" | ||
} | ||
variable "private_key" { | ||
description = "The private API key for MongoDB Atlas" | ||
default = "" | ||
} | ||
variable "project_name" { | ||
description = "Atlas project name" | ||
default = "" | ||
} | ||
variable "org_id" { | ||
description = "The organization ID" | ||
default = "" | ||
} | ||
variable "username" { | ||
description = "Username" | ||
default = "" | ||
} | ||
variable "role_name" { | ||
description = "The role name" | ||
default = "" | ||
} | ||
variable "aws_access_key" { | ||
description = "The access key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_secret_key" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_vpc_id" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_subnet_ids" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} | ||
variable "aws_sg_ids" { | ||
description = "The secret key for AWS Account" | ||
default = "" | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/test-upgrade/v100/privatelink-endpoint/v100/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
mongodbatlas = { | ||
source = "mongodb/mongodbatlas" | ||
version = "0.1.0-dev" | ||
} | ||
} | ||
required_version = ">= 0.15" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.