Repository navigation
feat!: remove deprecated Network Edge attributes - #1008
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
linkblock fromequinix_network_device_link, leavingmetro_linkas 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_linkis aTypeSetbut the schema does not specify aSethash function, while the read/flatten path tries to match existing items vianetworkDeviceLinkMetroLinkHash(...). Without settingSet: networkDeviceLinkMetroLinkHash, the hashes used by Terraform for the set won't match the custom hash used inflattenNetworkDeviceLinkMetroLinks, soaccount_numberlikely 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
networkDeviceLinkMetroLinkKeyusesnetworkDeviceLinkConnectionSchemaNames[...]whenvis amap[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 existingmetro_linkitems. UsenetworkDeviceLinkMetroSchemaNames["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.subnetis markedOptional: truein the schema, but the docs/templates in this PR describe it as required (and withsubnetsremoved there's no longer an alternate source definition). Consider makingsubnetrequired 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,
},
|
Ideally this is merged in the same release as #1006 |
|
@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. |
|
@copilot , Validate docs is failing, please run |
Ran 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
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>
…to MetroCode Agent-Logs-Url: https://github.com/equinix/terraform-provider-equinix/sessions/94c0c37b-81d6-4b77-b8ab-32a0df7813ea Co-authored-by: rling-equinix <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>
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>
Agent-Logs-Url: https://github.com/equinix/terraform-provider-equinix/sessions/81658aa1-7703-4935-9595-1c460690a91d Co-authored-by: rling-equinix <82846950+rling-equinix@users.noreply.github.com>
2f7fa1b to
345c5b6
Compare
|
Hi @displague, |
|
This PR is included in version 5.0.0 🎉 |
Remove deprecated attributes from
equinix_network_acl_templateandequinix_network_device_linkresources ahead of the next major release.equinix_network_acl_template:metro_codeattribute (was: Metro Code is no longer required)device_id computedattribute (replaced bydevice_details)inbound_rule.source_typecomputed attribute (was not returned)inbound_rule.subnetsattribute (replaced byinbound_rule.subnet)flattenACLTemplateInboundRulesto drop the now-unusedexistingRulesargument andcheckExistingSubnetshelperImportStatePassthrough->ImportStatePassthroughContextequinix_network_device_link:link block(replaced bymetro_link)link.src_zone_codeattribute (was not required)link.dst_zone_codeattribute (was not required)associatedexpand/flatten/hash functions and schema helpersUpdate
example_1.tfforequinix_network_device_linkto usemetro_linkRegenerate docs via
make docs.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com