Network Loadbalancer forwarding rule

network_load_balancer_rule

This is a simple module that supports creating or removing NATGateway Flowlog rules. This module has a dependency on ionoscloud >= 6.0.2

Example Syntax


name: Create Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  name: 'AnsibleAutoTestNLB'
  algorithm: ROUND_ROBIN
  protocol: TCP
  listener_ip: 10.12.118.224
  listener_port: '8081'
  targets:
  - ip: 22.231.2.2
    port: '8080'
    weight: '123'
  health_check:
    client_timeout: 50
    connect_timeout: 5000
    target_timeout: 5000
    retries: 1
  datacenter: ''
  network_load_balancer: ''
  wait: true
register: nlb_forwarding_rule_response


name: Update Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  datacenter: ''
  network_load_balancer: ''
  forwarding_rule: ''
  name: 'AnsibleAutoTestNLB - UPDATED'
  algorithm: ROUND_ROBIN
  protocol: TCP
  wait: true
  state: update
register: nlb_forwarding_rule_update_response


name: Delete Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  datacenter: ''
  network_load_balancer: ''
  forwarding_rule: ''
  state: absent

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "forwarding_rule": {
        "href": "https://api.ionos.com/cloudapi/v6/datacenters/89d7e3e1-a688-4ebd-ab01-8beac27e1f8a/networkloadbalancers/c8fb9d9b-a8ef-4358-a275-c23717aebb51/forwardingrules/6dec4e0c-dd8d-4348-acd1-2d0bf16d00e2",
        "id": "6dec4e0c-dd8d-4348-acd1-2d0bf16d00e2",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-05-31T13:08:44+00:00",
            "etag": "fb2a7f7680346fe0677dc3d76d652be6",
            "last_modified_by": "<USER_EMAIL>",
            "last_modified_by_user_id": "<USER_ID>",
            "last_modified_date": "2023-05-31T13:08:44+00:00",
            "state": "BUSY"
        },
        "properties": {
            "algorithm": "ROUND_ROBIN",
            "health_check": {
                "client_timeout": 50,
                "connect_timeout": 5000,
                "retries": 1,
                "target_timeout": 5000
            },
            "listener_ip": "<IP>",
            "listener_port": 8081,
            "name": "AnsibleAutoTestNLB",
            "protocol": "TCP",
            "targets": [
                {
                    "health_check": null,
                    "ip": "<IP>",
                    "port": 8080,
                    "weight": 123
                }
            ]
        },
        "type": "forwarding-rule"
    }
}

For more examples please check out the tests here.

state: present

  
name: Create Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  name: 'AnsibleAutoTestNLB'
  algorithm: ROUND_ROBIN
  protocol: TCP
  listener_ip: 10.12.118.224
  listener_port: '8081'
  targets:
  - ip: 22.231.2.2
    port: '8080'
    weight: '123'
  health_check:
    client_timeout: 50
    connect_timeout: 5000
    target_timeout: 5000
    retries: 1
  datacenter: ''
  network_load_balancer: ''
  wait: true
register: nlb_forwarding_rule_response

Available parameters for state present:

Name
Required
Description

name str

True

The name of the Network Load Balancer forwarding rule.

algorithm str

True

Balancing algorithm

protocol str

True

Balancing protocol

listener_ip str

True

Listening (inbound) IP.

listener_port str

True

Listening (inbound) port number; valid range is 1 to 65535.

health_check dict

False

Health check properties for Network Load Balancer forwarding rule.

targets list

True

Array of items in the collection.

datacenter str

True

The ID or name of the datacenter.

network_load_balancer str

True

The ID or name of the Network Loadbalancer.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: absent

  
name: Delete Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  datacenter: ''
  network_load_balancer: ''
  forwarding_rule: ''
  state: absent

Available parameters for state absent:

Name
Required
Description

name str

False

The name of the Network Load Balancer forwarding rule.

datacenter str

True

The ID or name of the datacenter.

network_load_balancer str

True

The ID or name of the Network Loadbalancer.

forwarding_rule str

True

The ID or name of the Network Loadbalancer forwarding rule.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: update

  
name: Update Network Load Balancer Forwarding Rule
ionoscloudsdk.ionoscloud.network_load_balancer_rule:
  datacenter: ''
  network_load_balancer: ''
  forwarding_rule: ''
  name: 'AnsibleAutoTestNLB - UPDATED'
  algorithm: ROUND_ROBIN
  protocol: TCP
  wait: true
  state: update
register: nlb_forwarding_rule_update_response

Available parameters for state update:

Name
Required
Description

name str

False

The name of the Network Load Balancer forwarding rule.

algorithm str

False

Balancing algorithm

protocol str

False

Balancing protocol

listener_ip str

False

Listening (inbound) IP.

listener_port str

False

Listening (inbound) port number; valid range is 1 to 65535.

health_check dict

False

Health check properties for Network Load Balancer forwarding rule.

targets list

False

Array of items in the collection.

datacenter str

True

The ID or name of the datacenter.

network_load_balancer str

True

The ID or name of the Network Loadbalancer.

forwarding_rule str

True

The ID or name of the Network Loadbalancer forwarding rule.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

Last updated