clc_public_ip

Manages a CLC public ip (for an existing server).

See also Complete API documentation.

Example Usage

# Provision a public ip
resource "clc_public_ip" "backdoor" {
  server_id           = "${clc_server.node.0.id}"
  internal_ip_address = "${clc_server.node.0.private_ip_address}"

  ports {
    protocol = "ICMP"
    port     = -1
  }

  ports {
    protocol = "TCP"
    port     = 22
  }

  ports {
    protocol = "TCP"
    port     = 2000
    port_to  = 9000
  }

  source_restrictions {
    cidr = "85.39.22.15/30"
  }
}

output "ip" {
  value = "clc_public_ip.backdoor.id"
}

Argument Reference

The following arguments are supported:

Ports

ports is a block within the configuration that may be repeated to specify open ports on the target IP. Each ports block supports the following:

  • protocol (Required, string) One of "tcp", "udp", "icmp".
  • port (Required, int) The port to open. If defining a range, demarks starting port
  • portTo (Optional, int) Given a port range, demarks the ending port.

SourceRestrictions

source_restrictions is a block within the configuration that may be repeated to restrict ingress traffic on specified CIDR blocks. Each source_restrictions block supports the following:

  • cidr (Required, string) The IP or range of IPs in CIDR notation.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/clc/r/public_ip.html