-
Notifications
You must be signed in to change notification settings - Fork 75
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 support for NAT rules using proxied NSX-V API #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Before merge, please confirm two functional aspects:
- That NAT rule(s) created by this method may be updated via H5 UI and vice versa (that these operations don't collide anymore).
- That it will be possible from Terraform side to create a DNAT rule on an external network with an org admin connection (with current DNAT rule that's not possible though in UI it is).
Yes, they can be updated. II have manually tested it using terraform resources and "read" capabilities, which hint updates.
Yes, it must be so. It does not try to access any other resources outside of edge gateway. If the edge gateway has an external network attached - it uses it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, overall looks good. Some comments for improvement or discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR aims to add support for methods to allow configuring Edge Gateway NAT rules using proxied NSX-V API.
It introduces a few new methods:
CreateNsxvNatRule
,UpdateNsxvNatRule
,GetNsxvNatRuleById
andDeleteNsxvNatRuleById
.The creation of above mentioned NAT rules requires to specify a vNic (network interface on edge gateway). To easen lookup of vNic and replicating similar behaviour as vCD UI two more methods are added:
GetVnicIndexByNetworkNameAndType
andGetNetworkNameAndTypeByVnicIndex
. They allow to convert between vNic index number and network type and network name.It should also be compatible with subinterfaces when we implement them in other places: https://github.com/terraform-providers/terraform-provider-vcd/issues/321