Replies: 1 comment
-
|
This was either moved to an issue or duplicated by one (relevant issues look to be #363 and #629). With the introduction of BGP on VRF connections, it became necessary to adopt, roughly, the approach mentioned in this discussion, so that the existing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Creating dedicated terraform resources for objects that are managed by the API
Background
We recently ran into an issue with using the
metal_connectionresource to manage shared connections. For shared connection, users can specify thevlansattribute in order to attach VLANs to the connection's ports. This is supported via a single call to the create connection API. However, changes to thevlansattribute were silently ignored because the update connection API does not support updating VLANs for a shared connection. We evaluated a few different options for changing the behavior of themetal_connectionresource when thevlansattribute is changed, and eventually implemented additional calls from themetal_connectionresource to the update virtual circuit API to update VLANs for a terraform-managed shared connection. However, hiding additional logic in our terraform resources in this manner makes our user's terraform configs less explicit.Managing shared connection VLANs with metal_virtual_circuit
Ultimately, the issue we're running up against for shared
metal_connectionVLANs is that the API creates hidden virtual circuits (or hidden ports & virtual circuits?) for shared connections, and the API only allows users to manage these hidden virtual circuits via the connection API when a connection is created. After a connection is created, the hidden virtual circuits must be managed with the virtual circuit API.Instead of managing shared
metal_connectionVLANs via themetal_connectionresource, we could enable customers to manage those VLANs with themetal_virtual_circuitresource, so that network configuration is more consistent between shared & dedicated connections, and so that we are not hiding virtual circuit management in ourmetal_connectionresource.Dedicated connection VLAN management
[WIP] example of managing VLANs for a dedicated metal connection; I don't know if this reflects reality yet.
Shared connection VLAN management
With some changes to the
metal_virtual_circuitresource, we could use that resource to manage shared connection virtual circuits instead of hiding that logic in themetal_connectionresource.The below HCL example assumes that the
metal_virtual_circuitresource gains a newtypeattribute (could be abehaviorinstead?). Whentypeis"shared", themetal_virtual_circuitexpects theidattribute to be provided. On create, it makes aVCUpdateRequestinstead ofVCCreateRequest, passing thevlan_id/vnidspecified in the configuration. On delete, it makes aVCUpdateRequestinstead ofVCDeleteRequest, passing""as thevlan_id/vnid.While this is more verbose than hiding the shared virtual circuit logic in the
metal_connectionresource, it is also more explicit/intentional, and it more closely matches the reality of how these hidden virtual circuits are managed. In the web UI, for example, you can only change shared connection VLANs one at a time, and swapping VLANs requires at least 3 button clicks.Beta Was this translation helpful? Give feedback.
All reactions