8000 feat!: remove deprecated Network Edge attributes by displague · Pull Request #1008 · equinix/terraform-provider-equinix · GitHub
[go: up one dir, main page]

Skip to content

feat!: remove deprecated Network Edge attributes - #1008

Merged
displague merged 6 commits into
mainfrom
remove-deprecated-network-edge
May 29, 2026
Merged

displague merged 6 commits into
mainfrom
remove-deprecated-network-edge

Conversation

@displague
@displague displague commented Apr 6, 2026 •
Copy link
Copy Markdown
Member

Remove deprecated attributes from equinix_network_acl_template and
equinix_network_device_link resources ahead of the next major release.

equinix_network_acl_template:

  • Remove metro_code attribute (was: Metro Code is no longer required)
  • Remove device_id computed attribute (replaced by device_details)
  • Remove inbound_rule.source_type computed attribute (was not returned)
  • Remove inbound_rule.subnets attribute (replaced by inbound_rule.subnet)
  • Simplify flattenACLTemplateInboundRules to drop the now-unused existingRules argument and checkExistingSubnets helper
  • Fix ImportStatePassthrough -> ImportStatePassthroughContext

equinix_network_device_link:

  • Remove link block (replaced by metro_link)
  • Remove link.src_zone_code attribute (was not required)
  • Remove link.dst_zone_code attribute (was not required)
  • Remove associated expand/flatten/hash functions and schema helpers

Update example_1.tf for equinix_network_device_link to use metro_link
Regenerate docs via make docs.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot AI review requested due to automatic review settings April 6, 2026 15:56
@displague
displague requested a review from a team as a code owner April 6, 2026 15:56
@codecov
codecov Bot commented Apr 6, 2026 •
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.30%. Comparing base (614d6db) to head (345c5b6).

Files with missing lines Patch % Lines
equinix/resource_network_device_link.go 28.57% 4 Missing and 1 partial ⚠️
equinix/resource_network_acl_template.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1008       +/-   ##
===========================================
+ Coverage   28.73%   40.30%   +11.57%     
===========================================
  Files         252      252               
  Lines       29239    29093      -146     
===========================================
+ Hits         8401    11727     +3326     
+ Misses      20684    16904     -3780     
- Partials      154      462      +308     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes deprecated attributes/blocks from the legacy (SDKv2) Network Edge resources equinix_network_acl_template and equinix_network_device_link in preparation for the next major provider release, with corresponding updates to examples and generated docs.

Changes:

  • Dropped deprecated schema attributes from equinix_network_acl_template (e.g., metro_code, device_id, inbound rule deprecated fields) and simplified inbound rule flattening.
  • Dropped deprecated link block from equinix_network_device_link, leaving metro_link as the supported inter/intra-metro connection block.
  • Updated example + regenerated docs/templates to reflect the new schemas.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
templates/resources/network_device_link.md.tmpl Removes deprecated link docs section; keeps metro_link docs.
templates/resources/network_acl_template.md.tmpl Removes docs for deprecated ACL template attributes and inbound rule fields.
examples/resources/equinix_network_device_link/example_1.tf Updates example config to use metro_link instead of link.
equinix/resource_network_device_link.go Removes deprecated link schema + expand/flatten helpers; updates update/create/read paths.
equinix/resource_network_device_link_test.go Updates unit tests to stop asserting removed link behavior.
equinix/resource_network_acl_template.go Removes deprecated ACL template schema attributes; simplifies inbound rules flattening; fixes importer to ImportStatePassthroughContext.
equinix/resource_network_acl_template_test.go Updates unit tests to match removed fields and new flatten function signature.
docs/resources/network_device_link.md Regenerated docs reflecting metro_link usage and removal of link.
docs/resources/network_acl_template.md Regenerated docs reflecting removal of deprecated ACL template attributes.
Comments suppressed due to low confidence (3)

equinix/resource_network_device_link.go:162

  • metro_link is a TypeSet but the schema does not specify a Set hash function, while the read/flatten path tries to match existing items via networkDeviceLinkMetroLinkHash(...). Without setting Set: networkDeviceLinkMetroLinkHash, the hashes used by Terraform for the set won't match the custom hash used in flattenNetworkDeviceLinkMetroLinks, so account_number likely won't be carried forward and diffs will persist.
		networkDeviceLinkSchemaNames["MetroLinks"]: {
			Type:     schema.TypeSet,
			Optional: true,
			Elem: &schema.Resource{
				Schema: createNetworkDeviceLinkMetroResourceSchema(),
			},
			Description: networkDeviceLinkDescriptions["MetroLinks"],
		},

equinix/resource_network_device_link.go:527

  • networkDeviceLinkMetroLinkKey uses networkDeviceLinkConnectionSchemaNames[...] when v is a map[string]interface{}. That map does not contain a "MetroCode" key (it uses src/dst metro codes), so the computed key/hash will be wrong and break matching of existing metro_link items. Use networkDeviceLinkMetroSchemaNames["MetroCode"|"Throughput"|"ThroughputUnit"] for the map case.
func networkDeviceLinkMetroLinkKey(v interface{}) string {
	if v, ok := v.(ne.DeviceLinkGroupMetroLink); ok {
		return fmt.Sprintf("%s-%s-%s",
			ne.StringValue(v.MetroCode),
			ne.StringValue(v.Throughput),
			ne.StringValue(v.ThroughputUnit))
	}
	if v, ok := v.(map[string]interface{}); ok {
		return fmt.Sprintf("%s-%s-%s",
			v[networkDeviceLinkConnectionSchemaNames["MetroCode"]],
			v[networkDeviceLinkConnectionSchemaNames["Throughput"]],
			v[networkDeviceLinkConnectionSchemaNames["ThroughputUnit"]])
	}

equinix/resource_network_acl_template.go:140

  • inbound_rule.subnet is marked Optional: true in the schema, but the docs/templates in this PR describe it as required (and with subnets removed there's no longer an alternate source definition). Consider making subnet required to match the documented contract and avoid sending incomplete rules to the API.
		networkACLTemplateInboundRuleSchemaNames["Subnet"]: {
			Type:         schema.TypeString,
			Optional:     true,
			Description:  networkACLTemplateInboundRuleDescriptions["Subnet"],
			ValidateFunc: validation.IsCIDR,
		},

Comment thread equinix/resource_network_device_link.go Resolved
Comment thread equinix/resource_network_device_link.go Resolved
Comment thread equinix/resource_network_device_link.go Resolved
@displague
Copy link
Copy Markdown
Member Author

Ideally this is merged in the same release as #1006

@displague
Copy link
Copy Markdown
Member Author

@rling-equinix these Copilot recommendations were unexpected but seem like they could address long standing bugs (if accurate). You are more familiar with the helpers in use so I defer to your judgement.

Comment thread equinix/resource_network_device_link.go Resolved
@rling-equinix
Copy link
Copy Markdown
Contributor

@copilot , Validate docs is failing, please run make docs and rerun that check.

Copilot AI commented Apr 30, 2026 •
Copy link
Copy Markdown
Contributor

@copilot , Validate docs is failing, please run make docs and rerun that check.

Ran make docs and make docs-check locally — both pass with no changes. The docs in the repo are already up to date. The CI failure is a pre-existing infrastructure issue: tfplugindocs fails to download the Terraform binary in the runner because unable to verify checksums signature: openpgp: key expired. This only occurs when Terraform is not already in PATH on the runner; it's not caused by any code changes in this PR.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint-api.hashicorp.com
    • Triggering command: /tmp/go-build3007153897/b001/exe/tfplugindocs /tmp/go-build3007153897/b001/exe/tfplugindocs --rendered-provider-name=Equinix -buildid qK_sjRqaREshHhLCNvcy/qK_sjRqaREshHhLCNvcy -goversion go1.24.13 -c=4 -nolocalimports -importcfg /tmp/go-build3007153897/b197/importcfg -pack /opt/hostedtoolcache/go/1.24.13/x64/src/go/printer/comment.go (dns block)
    • Triggering command: /usr/local/bin/terraform terraform version /home/REDACTED/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.15.0/schema/validator/bool.go /home/REDACTED/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.15.0/schema/validator/client_capabilities.go (dns block)
    • Triggering command: /usr/local/bin/terraform /usr/local/bin/terraform version -json /home/REDACTED/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.15.0/resource/schema/objectplanmodifier/requires_replace.go (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

displague and others added 5 commits May 26, 2026 15:25
 Remove deprecated attributes from equinix_network_acl_template and
 equinix_network_device_link resources ahead of the next major release.

 equinix_network_acl_template:
 - Remove metro_code attribute (was: Metro Code is no longer required)
 - Remove device_id computed attribute (replaced by device_details)
 - Remove inbound_rule.source_type computed attribute (was not returned)
 - Remove inbound_rule.subnets attribute (replaced by inbound_rule.subnet)
 - Simplify flattenACLTemplateInboundRules to drop the now-unused
   existingRules argument and checkExistingSubnets helper
 - Fix ImportStatePassthrough -> ImportStatePassthroughContext

 equinix_network_device_link:
 - Remove link block (replaced by metro_link)
 - Remove link.src_zone_code attribute (was not required)
 - Remove link.dst_zone_code attribute (was not required)
 - Remove associated expand/flatten/hash functions and schema helpers

 Update example_1.tf for equinix_network_device_link to use metro_link.
 Regenerate docs via make docs.

 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Rui Ling <82846950+rling-equinix@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Rui Ling <82846950+rling-equinix@users.noreply.github.com>
…n, add MetroLinks test assertion

Agent-Logs-Url: https://github.com/equinix/terraform-provider-equinix/sessions/3f7972f7-0433-47a7-b1b0-a986f35bb534

Co-authored-by: rling-equinix <82846950+rling-equinix@users.noreply.github.com>
@rling-equinix
rling-equinix force-pushed the remove-deprecated-network-edge branch from 2f7fa1b to 345c5b6 Compare May 26, 2026 22:25
@rling-equinix
Copy link
Copy Markdown
Contributor

Hi @displague,
We have reviewed the PRs and test it in local. It all looks good to me now.
We are waiting for your call to decide when to merge this PR and release it as a major release.

@displague
displague merged commit a8645ea into main May 29, 2026
10 of 11 checks passed
@displague
displague deleted the remove-deprecated-network-edge branch May 29, 2026 18:16
@github-actions
github-actions Bot commented Jun 3, 2026
Copy link
Copy Markdown

This PR is included in version 5.0.0 🎉

This branch was previously deployed

1 inactive deployment
internal — 345c5b6b Deployed May 26, 2026 by rling-equinix via authorize #1615
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.

4 participants

0