Skip to content
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

Network peering #43

Merged
merged 8 commits into from
Oct 1, 2019
Merged

Network peering #43

merged 8 commits into from
Oct 1, 2019

Conversation

PacoDw
Copy link
Contributor

@PacoDw PacoDw commented Oct 1, 2019

  • Added atlas_gcp_project_id and atlas_vpc_name to peering state to be more easy the flow.
  • The documentation was updated.
  • The GCP test case was updated.

You can use the following configuration to create the reciprocal connection:

locals {
  project_id        = <your-project-id>
  google_project_id = <your-google-project-id>
}

resource "mongodbatlas_network_container" "test" {
  project_id       = local.project_id
  atlas_cidr_block = "192.168.192.0/18"
  provider_name    = "GCP"
}

resource "mongodbatlas_private_ip_mode" "my_private_ip_mode" {
  project_id = local.project_id
  enabled    = true
}

resource "mongodbatlas_network_peering" "test" {
  project_id     = local.project_id
  container_id   = mongodbatlas_network_container.test.container_id
  provider_name  = "GCP"
  network_name   = "myNetWorkPeering"
  gcp_project_id = local.google_project_id

  depends_on = [mongodbatlas_private_ip_mode.my_private_ip_mode]
}

resource "google_compute_network" "vpc_network" {
  name = "vpcnetwork"
}

resource "google_compute_network_peering" "gcp_main_atlas_peering" {
  name         = "atlas-gcp-main"
  network      = google_compute_network.vpc_network.self_link
  peer_network = "projects/${mongodbatlas_network_peering.test.atlas_gcp_project_id}/global/networks/${mongodbatlas_network_peering.test.atlas_vpc_name}"
}

closes #29 , #41

Copy link
Contributor

@marinsalinas marinsalinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check the make lint issue?

@PacoDw
Copy link
Contributor Author

PacoDw commented Oct 1, 2019

@marinsalinas this appears:

==> Checking source code against linters...
/bin/sh: golangci-lint: command not found
make: *** [lint] Error 127

Maybe is regarding this issue: golangci/golangci-lint#308

@marinsalinas
Copy link
Contributor

marinsalinas commented Oct 1, 2019

@marinsalinas this appears:

==> Checking source code against linters...
/bin/sh: golangci-lint: command not found
make: *** [lint] Error 127

you should run make tools before.

The lint error is the following:

==> Checking source code against linters...
mongodbatlas/resource_mongodbatlas_network_container.go:22:2: `errorContainerDelete` is unused (varcheck)
	errorContainerDelete  = "error deleting MongoDB Network Peering Container (%s): %s"

@PacoDw PacoDw force-pushed the networkPeering branch 2 times, most recently from 3151119 to 6e59f47 Compare October 1, 2019 19:25
Copy link
Contributor

@marinsalinas marinsalinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Waiting for @themantissa review to merge it!

Copy link
Collaborator

@themantissa themantissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving (if my slack comment to you about how this flows is right). It's a very nice way to handle this!

@marinsalinas marinsalinas merged commit 5cee249 into master Oct 1, 2019
@marinsalinas marinsalinas deleted the networkPeering branch October 1, 2019 21:29
@davidepedranz davidepedranz mentioned this pull request Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug VPC Peering between GCP and Atlas
3 participants