Skip to content
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

Can't create dnat rule for all ports #880

Closed
Juanito87 opened this issue Jan 28, 2021 · 0 comments · Fixed by #886
Closed

Can't create dnat rule for all ports #880

Juanito87 opened this issue Jan 28, 2021 · 0 comments · Fixed by #886

Comments

@Juanito87
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
terraform v0.14.5

Affected Resource(s)

Please list the resources as a list, for example:

  • huaweicloud_compute_instance

  • huaweicloud_cce_node

  • huaweicloud_nat_dnat_rule
    If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

This config works:

resource "huaweicloud_nat_dnat_rule" "all-ports" {
    floating_ip_id        = huaweicloud_vpc_eip.eip_testing-in.id
    nat_gateway_id        = huaweicloud_nat_gateway.maingw.id
    private_ip            = huaweicloud_compute_instance.demo-2.access_ip_v4
    protocol              = "tcp"
    internal_service_port = 22
    external_service_port = 22
}

This one does not:

resource "huaweicloud_nat_dnat_rule" "all-ports" {
    floating_ip_id        = huaweicloud_vpc_eip.eip_testing-in.id
    nat_gateway_id        = huaweicloud_nat_gateway.maingw.id
    private_ip            = huaweicloud_compute_instance.demo-2.access_ip_v4
    protocol              = "any"
    internal_service_port = 0
    external_service_port = 0
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

https://gist.github.com/Juanito87/e247b54b3e0e59edea9c6dbb09f5963b#file-dnat-fail-log

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

It should create a dnat rule redirecting all ports, like in the gui.

Actual Behavior

What actually happened?
It says tha no internal or external port configured and fails.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

  2. Plan a dnat rule that uses protocol "any" and ports 0 (internal and external) for a ecs.

  3. apply it

  4. Error asking for external_service_port requiered.

WindowsTerminal_n2b2RxdkJm

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Batch processing multiple resources? Poor network quality?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant