-
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-208: Updated docs for upgrading private endpoints (#458)
* added validation for github actions automated test * added terratest for upgrading private endpoints * added examples for test upgrade private endpoint * docs: update upgrading for private endpoint * added folder for testing integration to see if it works or not * rollback * updated doc * added doc links for the recent resources Co-authored-by: Edgar López <[email protected]>
- Loading branch information
Showing
9 changed files
with
308 additions
and
0 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
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,41 @@ | ||
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/v090/private-endpoint/v080/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 = "" | ||
} |
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.8.0" | ||
} | ||
} | ||
required_version = ">= 0.13" | ||
} |
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,30 @@ | ||
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 | ||
} |
45 changes: 45 additions & 0 deletions
45
examples/test-upgrade/v090/private-endpoint/v090/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,45 @@ | ||
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 = "" | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
examples/test-upgrade/v090/private-endpoint/v090/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,10 @@ | ||
terraform { | ||
required_providers { | ||
mongodbatlas = { | ||
source = "mongodb/mongodbatlas" | ||
version = "0.9.0" | ||
} | ||
} | ||
required_version = ">= 0.13" | ||
} | ||
|
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 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