Skip to content

Latest commit

 

History

History
66 lines (52 loc) · 2.61 KB

vpc_subnet.md

File metadata and controls

66 lines (52 loc) · 2.61 KB

vpc_subnet

Create, read, and update a Linode VPC Subnet.

Minimum Required Fields

Field Type Required Description
api_token str Required The Linode account personal access token. It is necessary to run the module.
It can be exposed by the environment variable LINODE_API_TOKEN instead.
See details in Usage.

Examples

- name: Create a VPC Subnet
  linode.cloud.vpc_subnet:
    vpc_id: 12345
    label: my-subnet
    ipv4: '10.0.0.0/24'
    state: present
- name: Delete a VPC Subnet
  linode.cloud.vpc_subnet:
    vpc_id: 12345
    label: my-subnet
    state: absent

Parameters

Field Type Required Description
vpc_id int Required The ID of the parent VPC for this subnet.
label str Required This VPC's unique label.
state str Required The state of this token. (Choices: present, absent)
ipv4 str Optional The IPV4 range for this subnet in CIDR format.

Return Values

  • subnet - The VPC in JSON serialized form.

    • Sample Response:
      {
          "created": "2023-08-31T18:53:04",
          "id": 271,
          "ipv4": "10.0.0.0/24",
          "label": "test-subnet",
          "linodes": [
              {
                  "id": 1234567,
                  "interfaces": [{"active": false, "id": 654321}]
              }
          ],
          "updated": "2023-08-31T18:53:04"
      }
    • See the Linode API response documentation for a list of returned fields