Skip to content

Conversation

@rhariady
Copy link
Contributor

@rhariady rhariady commented Mar 21, 2025

Currently when we create interconnect attachment with PARTNER type, GCP will automatically create a router interface and peers for us (with management_type attribute set to MANAGED_BY_ATTACHMENT). Because of this, using interconnect_attachment module from this repo to provision a PARTNER type interconnect will fail because it will try to create another interface and peer, while GCP only allow 1 interface per attachment and IP type (see issue #7)

This PR will allow interface (and peer) creation to be optional by introducing new value named create_interface. When the value is false, it won't create the interface and peers resource. User can later import this resources from the one automatically generated by GCP.

This PR also add edge_availability_domain argument and set default value for several variable so it will work right away with PARTNER interconnect type.

module "interconnect" {
  source = "./interconnect_attachment"

  name         = "test-interconnect"
  description  = "test"
  type         = "PARTNER"
  project      = "prj-test-interconnect"
  region       = "asia-southeast2"
  router       = module.interconnect_cloud_router.router.name
  mtu          = "1440"

  edge_availability_domain = "AVAILABILITY_DOMAIN_1"

  create_interface = false

  admin_enabled = false
}

Fix #7

@rhariady rhariady requested review from a team and imrannayer as code owners March 21, 2025 09:49
@rhariady rhariady force-pushed the feat/partner_interconnect branch from 8f61b06 to 89f7eaf Compare March 21, 2025 09:50
@rhariady rhariady changed the title [Feat] partner interconnect [feat] partner interconnect Mar 21, 2025
@rhariady rhariady changed the title [feat] partner interconnect feat: partner interconnect Mar 21, 2025
@imrannayer
Copy link
Collaborator

@rhariady thx for the PR.
See my comments

@rhariady rhariady requested a review from imrannayer April 23, 2025 05:08
@rhariady
Copy link
Contributor Author

@rhariady thx for the PR. See my comments

Thanks @imrannayer! And I think I have followed up all your comment.

BTW, I also add moved block to moved module.interface to module.interface[0] in interconnect_attachment module, so it will working for existing usage.

@imrannayer
Copy link
Collaborator

@rhariady lint test failed

@rhariady
Copy link
Contributor Author

@rhariady lint test failed

@imrannayer Ahh, yes. I was using latest version of terraform-docs.

Fixed BTW.

@imrannayer
Copy link
Collaborator

@rhariady can u plz resolve the conflicts

@rhariady
Copy link
Contributor Author

@rhariady can u plz resolve the conflicts
resolved @imrannayer. And i fixed issue the last lint error as well, hope it's all good now.

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer merged commit 0cff190 into terraform-google-modules:main Apr 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

partner interconnect not supported

2 participants