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

Add VRF Support #129

Merged
merged 25 commits into from
May 2, 2022
Merged

Add VRF Support #129

merged 25 commits into from
May 2, 2022

Conversation

displague
Copy link
Member

@displague displague commented Apr 21, 2022

Related to: equinix/terraform-provider-metal#220

  • Add Metal VRF Resource Support
    • Datasource
    • Docs (Resource and Datasource)
  • Add Metal VRF Support for IP Reservations
    • Datasource
    • Docs (Resource and Datasource)
  • Add Metal VRF Support for Metal Gateway devices
    • Datasource
    • Docs (Resource and Datasource)
  • Add Metal VRF Support for Metal Connection Virtual Circuits
    • Docs (Resource and Datasource)

To run this branch locally:

OS="darwin" # or linux
ARCH="amd64"
VER=1.6.0-vrf
SOURCE=developer.equinix.com/equinix/equinix
PLUGIN_DIR=~/.terraform.d/plugins/${SOURCE}/${VER}/${OS}_${ARCH}/
cd ~/your-favorite-code-path
git clone https://github.com/equinix/terraform-provider-equinix
git checkout vrf
cd terraform-provider-equinix
make
mkdir -p $PLUGIN_DIR
cp terraform-provider-equinix $PLUGIN_DIR

Update your required_versions (usually in main.tf or versions.tf):

terraform {
  required_providers {
    equinix = {
      # change this back to equinix/equinix  when not using this development build
      source = "developer.equinix.com/equinix/equinix"
      version = "1.6.0-vrf"
    }
  }
}

Example resources:

resource "equinix_metal_vrf" "foo" {
	name = ...
        description = ...
	metro = ...
	project_id = ...
      	local_asn = "65000"
	ip_ranges = ["192.168.100.0/25"]
}

resource "equinix_metal_reserved_ip_block" "foo" {
	vrf_id = ...
	cidr = 29
	description = ...
	network = "192.168.100.0"
	type = "vrf"
	metro = ...
	project_id = ...
}

Find other examples in the *acc_test.go files.

@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2022

Codecov Report

Merging #129 (edf5170) into master (eb4bf91) will decrease coverage by 1.57%.
The diff coverage is 89.81%.

@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
- Coverage   58.77%   57.20%   -1.58%     
==========================================
  Files          65       67       +2     
  Lines       10867    11190     +323     
==========================================
+ Hits         6387     6401      +14     
- Misses       4242     4574     +332     
+ Partials      238      215      -23     
Impacted Files Coverage Δ
equinix/data_source_metal_vlan.go 86.50% <0.00%> (-2.11%) ⬇️
equinix/config.go 54.36% <30.00%> (-3.08%) ⬇️
equinix/resource_metal_vrf.go 86.50% <86.50%> (ø)
equinix/data_source_metal_vrf.go 89.58% <89.58%> (ø)
equinix/resource_metal_virtual_circuit.go 77.19% <92.78%> (+41.64%) ⬆️
equinix/data_source_metal_connection.go 100.00% <100.00%> (ø)
equinix/data_source_metal_gateway.go 100.00% <100.00%> (ø)
equinix/data_source_metal_precreated_ip_block.go 73.78% <100.00%> (+17.78%) ⬆️
equinix/data_source_metal_reserved_ip_block.go 85.23% <100.00%> (+0.30%) ⬆️
equinix/provider.go 84.58% <100.00%> (+3.20%) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb4bf91...edf5170. Read the comment docs.

@displague displague force-pushed the vrf branch 2 times, most recently from a1c97c0 to 32e88fc Compare April 22, 2022 15:18
@displague displague added the enhancement New feature or request label Apr 22, 2022
@displague
Copy link
Member Author

I'm seeing some failed tests related to the POST /metal/v1/organizations endpoint. This PR did not introduce any changes in the vicinity of that resource.

I've reached out for more information about why this has started failing (the address field seems to be the culprit).

Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
…precreated_ip_block

Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
…VRF+VC tests

Signed-off-by: Marques Johansson <mjohansson@equinix.com>
…H Actions

Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
…ting vrf aware

Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
@displague displague marked this pull request as ready for review April 30, 2022 13:40
@displague
Copy link
Member Author

One final change needed is to update packngo in go.mod to the latest tagged release following equinixmetal-archive/packngo#326.

This branch currently refers to a git commit in the packngo PR. Merging this PR without an update to a tagged packngo will be safe unless the packngo PR is rebased.

displague added 3 commits May 2, 2022 08:36
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
@displague
Copy link
Member Author

I filed an issue related to some of the failed CI/CD tests: #130

I attempted to correct some of this in this PR but there are more than I missed. I believe we should address these in a separate PR (accepting the changes that are already committed in this PR).

Copy link
Contributor

@ocobles ocobles left a comment

Choose a reason for hiding this comment

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

Approved after revision in a screen sharing session. Awesome job 👌🏻👌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants