Ресурс servercore_vpc_public_port_v1
Creates and manages a direct public IP address (public port) in VPC using public API v1. For more information about direct public IP address, see the official Servercore documentation.
Example usage
resource "servercore_public_port_v1" "port_1" {
project_id = servercore_project_v2.project_1.id
region = "ru-6"
description = "my-own-direct-public-ip-port"
admin_state_up = false
security_group_ids = [openstack_networking_secgroup_v2.sg_1.id]
}
Argument Reference
-
project_id— (Required) Unique identifier of the associated project. Changing this creates a new public port. Retrieved from the servercore_project_v2 resource. Learn more about Projects. -
region— (Required) Pool where the public port is located, for example,ru-6. Changing this creates a new public port. Learn more about available pools in the Availability matrix. -
description— (Optional) Public port description. The default value is an empty string. -
admin_state_up— (Optional) Enables (true) or disables (false) the public port administratively. The default value istrue. -
security_group_ids— (Optional) List of OpenStack security group identifiers to associate with the public port. Learn more about the openstack_networking_secgroup_v2 resource in the official OpenStack documentation. The default value is the identifier of the default security group in the project.
Attributes Reference
-
network_id— Identifier of the service network to which the public port is attached. -
ip_address— Direct public IP address assigned to the public port. -
subnet— CIDR of the subnet in which the public port IP address is allocated. -
gateway— IP address of the subnet gateway.
Import
You can import a public port:
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export SEL_PROJECT_ID=<servercore_project_id>
export SEL_REGION=<servercore_pool>
terraform import servercore_public_port_v1.port <public_port_id>
where:
<account_id>— Servercore account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.<username>— Name of the service user. To get the name, in the top right corner of the Control panel, go to the account menu ⟶ Profile and Settings ⟶ User management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.<password>— Password of the service user.<servercore_project_id>— Unique identifier of the associated project. To get the project ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.<servercore_pool>— Pool where the public port is located, for example,ru-6. To get information about the pool, in the Control panel, go to Cloud Platform ⟶ Network ⟶ the Direct public IP addresses tab. The pool is under the IP address.<public_port_id>— Unique identifier of the public port, for example,b311ce58-2658-46b5-b733-7a0f418703f2. To get the public port ID, in the Control panel, go to Cloud Platform ⟶ Network ⟶ the Direct public IP addresses tab ⟶ copy the ID of the public port on the right side of the public port card.