TritonDataCenter / terraform-provider-triton

Terraform Joyent Triton provider
https://www.terraform.io/docs/providers/triton/
Mozilla Public License 2.0
15 stars 24 forks source link

Triton Firewall rule needs to strip newlines #105

Closed stack72 closed 6 years ago

stack72 commented 6 years ago

When a newline is included in a triton firewall rule, Terraform detects a perpetual diff

~ module.fabio.triton_firewall_rule.firewall_allow_9998
      rule:                        "FROM all vms TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 9998" => "FROM all vms TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 9998\n"

  ~ module.fabio.triton_firewall_rule.firewall_allow_https
      rule:                        "FROM any TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 443" => "FROM any TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 443\n"

  ~ module.fabio.triton_firewall_rule.firewall_allow_ssh
      rule:                        "FROM tag \"triton.cns.services\" = \"bastion\" TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 22" => "FROM TAG \"triton.cns.services\" = \"bastion\" TO tag \"triton.cns.services\" = \"fabio\" ALLOW tcp PORT 22\n"

This is due to using HEREDOCs rather than a string for the rule

We need to ensure that we ignore newlines from Terraform config - in the same way we do it for ssh keys