Skip to content

Fix serverless endpoint tests #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ func testAccDSMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID,
return fmt.Sprintf(`

data "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = "%[1]s"
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
instance_name = mongodbatlas_serverless_instance.test.name
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
endpoint_id = mongodbatlas_privatelink_endpoint_service_serverless.test.endpoint_id
}

resource "mongodbatlas_privatelink_endpoint_serverless" "test" {
project_id = "%[1]s"
instance_name = mongodbatlas_serverless_instance.test.name
provider_name = "AWS"
}
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
}


resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = "%[1]s"
instance_name = "%[2]s"
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
Expand All @@ -84,6 +84,10 @@ func testAccDSMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID,
provider_settings_provider_name = "SERVERLESS"
provider_settings_region_name = "US_EAST_1"
continuous_backup_enabled = true

lifecycle {
ignore_changes = [connection_strings_private_endpoint_srv]
}
}

`, projectID, instanceName, comment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@ func TestAccNetworkDSPrivateLinkEndpointsServiceServerless_basic(t *testing.T) {
func testAccMongoDBAtlasPrivateLinkEndpointsServerlessDataSourceConfig(projectID, instanceID, comments string) string {
return fmt.Sprintf(`
data "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = "%[1]s"
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
instance_name = mongodbatlas_serverless_instance.test.name
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
}
endpoint_id = mongodbatlas_privatelink_endpoint_service_serverless.test.endpoint_id
}

data "mongodbatlas_privatelink_endpoints_service_serverless" "test" {
project_id = "%[1]s"
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
instance_name = mongodbatlas_serverless_instance.test.name
}

resource "mongodbatlas_privatelink_endpoint_serverless" "test" {
project_id = "%[1]s"
instance_name = mongodbatlas_serverless_instance.test.name
provider_name = "AWS"
}
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
}


resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = "%[1]s"
instance_name = "%[2]s"
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
provider_name = "AWS"
comment = "%[3]s"
}
}

resource "mongodbatlas_serverless_instance" "test" {
project_id = "%[1]s"
Expand All @@ -65,6 +65,10 @@ func testAccMongoDBAtlasPrivateLinkEndpointsServerlessDataSourceConfig(projectID
provider_settings_provider_name = "SERVERLESS"
provider_settings_region_name = "US_EAST_1"
continuous_backup_enabled = true

lifecycle {
ignore_changes = [connection_strings_private_endpoint_srv]
}
}
`, projectID, instanceID, comments)
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID, in
project_id = "%[1]s"
instance_name = mongodbatlas_serverless_instance.test.name
provider_name = "AWS"
}
resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = "%[1]s"
instance_name = "%[2]s"
}


resource "mongodbatlas_privatelink_endpoint_service_serverless" "test" {
project_id = mongodbatlas_privatelink_endpoint_serverless.test.project_id
instance_name = mongodbatlas_privatelink_endpoint_serverless.test.instance_name
endpoint_id = mongodbatlas_privatelink_endpoint_serverless.test.endpoint_id
provider_name = "AWS"
comment = "%[3]s"
}
}

resource "mongodbatlas_serverless_instance" "test" {
project_id = "%[1]s"
Expand All @@ -109,6 +109,15 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(projectID, in
provider_settings_provider_name = "SERVERLESS"
provider_settings_region_name = "US_EAST_1"
continuous_backup_enabled = true

lifecycle {
ignore_changes = [connection_strings_private_endpoint_srv]
}
}

data "mongodbatlas_serverless_instance" "test" {
project_id = mongodbatlas_privatelink_endpoint_service_serverless.test.project_id
name = mongodbatlas_serverless_instance.test.name
}

`, projectID, instanceName, comment)
Expand Down