-
Notifications
You must be signed in to change notification settings - Fork 44
DNAT rule support for both OriginalPort and TranslatedPort #37
Comments
What's the correct way of fixing this? Should I perhaps rename the existing AddNATMapping() to something else, say AddNATMappingPorts(), then make it accept separate "originalPort" and "translatedPort" parameters, and then add AddNATMapping() again for backwards "compatibility", making it call the new AddNATMappingPorts() function giving the same "port" parameter as both "originalPort" and "translatedPort" ? |
Hi @pasikarkkainen, my suggested approach would be to try and keep backwards compatibility for other non-terraform users of the govcloudair library by renaming the current AddNATMapping() function to AddNATPortMapping() and extending the parameters to take src/dest ports, then creating a new wrapper function to replace AddNATMapping() than passed the port through to the new AddNATPortMapping() function as both the src & dst ports:
Please can you submit any PRs against the https://github.com/UKCloud/govcloudair fork of this vmware repo as we are in the process of enhancing the vcloud provider and have updated terraform to pull in our fork. We'll be more than happy to merge your changes. Any work done in our fork will be pushed back upstream to vmware's repo in due course. |
PR submitted here: |
@robcoward: I kept the backwards compatibility as you suggested, so existing AddNATMapping() and RemoveNATMapping() functions call the newly introduced AddNATPortMapping() and RemoveNATPortMapping(). |
It seems edgegateway.go func AddNATMapping(nattype, externalIP, internalIP, port string) lack support for being able to specify separate OriginalPort and TranslatedPort. Currently "port" parameter is used for both:
It'd be great to be able to add more flexible DNAT port mappings.. thoughts?
The text was updated successfully, but these errors were encountered: