arvancloud_iaas_public_ip (Resource)
Manages a public IP address for a compute server instance. This resource adds a public IP (IPv4 or IPv6) to a server, optionally assigning security groups.
Example Usage
resource "arvancloud_iaas_server" "web" {
name = "web-server"
flavor = "g1-2-2"
image = "ubuntu-22.04"
availability_zone = "ir-central1-a"
}
resource "arvancloud_iaas_security_group" "web_sg" {
name = "web-security-group"
availability_zone = "ir-central1-a"
}
resource "arvancloud_iaas_public_ip" "web_ipv4" {
server_id = arvancloud_iaas_server.web.id
availability_zone = "ir-central1-a"
ip_type = "ipv4"
security_groups = [arvancloud_iaas_security_group.web_sg.id]
}
resource "arvancloud_iaas_public_ip" "web_ipv6" {
server_id = arvancloud_iaas_server.web.id
availability_zone = "ir-central1-b"
ip_type = "ipv6"
security_groups = [arvancloud_iaas_security_group.web_sg.id]
}
Schema
Required
availability_zone(String) Availability zone where the server resides (e.g.,ir-central1-a).ip_type(String) Type of public IP to add:ipv4oripv6.server_id(String) ID of the compute server instance to add the public IP to.
Optional
security_groups(List of String) List of security group IDs to assign to the public IP.
Read-Only
id(String) Unique identifier for this public IP (format:{server_id}:{public_ip}).mac_address(String) The MAC address associated with the public IP.port_id(String) The port ID associated with the public IP.public_ip(String) The allocated public IP address.subnet_id(String) The subnet ID associated with the public IP.
Import
Import is supported using the following syntax:
terraform import arvancloud_iaas_public_ip.example "9972509b-8cbb-4b8f-9358-9e3cf1e66049:4.2.2.4"