v1

latestSwagger 2.02026-08-04232286653.5 KB
VPC Firewall Rules

Creates a VPC firewall rule in the project and returns the async operation.

post/projects/{project_id}/networking/vpc-firewall-rules

Path parameters

project_idstring required

Request body

action'allow' | 'deny' required

Action applied to traffic that matches the rule: allow or deny.

destination_portsstring[]

Destination ports the rule matches. Each entry is a single port or a port range (for example, 3000-8080).

direction'ingress' | 'egress' required

Direction of traffic the rule applies to: ingress (inbound) or egress (outbound).

namestring required

Name for the new firewall rule.

protocolsstring[] required

Network protocols the rule matches (for example, tcp, udp).

source_portsstring[]

Source ports the rule matches. Each entry is a single port or a port range (for example, 3000-8080).

vpc_network_idstring required

ID of the VPC network to create the rule in.

Example request

{
  "action": "allow",
  "destinations": [
    {
      "cidr": "10.1.2.3/24",
      "resource_id": "306aa10d-5570-4e47-88c9-46bf11bd8737"
    }
  ],
  "direction": "ingress",
  "name": "my-firewall-rule",
  "sources": [
    {
      "cidr": "10.1.2.3/24",
      "resource_id": "306aa10d-5570-4e47-88c9-46bf11bd8737"
    }
  ],
  "vpc_network_id": "09ae8411-0fbb-411c-898c-2b8f19622ae1"
}

Response

Example response

{
  "operation": {
    "completed_at": "2021-12-03T19:59:34Z",
    "metadata": "{}",
    "operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
    "result": "{}",
    "started_at": "2021-12-03T19:58:34Z",
    "state": "IN_PROGRESS"
  }
}