Skip to content

Commit

Permalink
feat: implement alb (#103)
Browse files Browse the repository at this point in the history
* fix: implement target group

* fix: update pipeline

* fix: update image id

* feat: add ALB module and test

* docs: update documentation with IONOS_API_URL information

* fix: renaming ALB Fw Rule module

* docs: add ALB docs

* docs: add ALB docs

* doc: fix indentation in summary.md

* feat: updated application load balancer modules

* doc: regenerated docs

* feat: updated target_group module

* feat: added multiple matching check for alb modules

* feat: added option to upload a new cerificate when creating an alb rule

* feat: working on certificate manager integration in alb

* feat: fixed error handling

* fix: fixed target group test, regenerated docs

* fix: remove certificate manager integration

* fix: added missing alb tests to workflows

* fix: added missing target group test

* chore: remove debug.txt

* fix: correct error in flowlog modules

* fix: typo in CI

* test: change test vars

* test: change test vars

* fix: pr review

Co-authored-by: mihaela-mh <[email protected]>
  • Loading branch information
rmocanu-ionos and mimihalescu authored Jun 28, 2022
1 parent 7fcf0c2 commit 0b11421
Show file tree
Hide file tree
Showing 21 changed files with 3,300 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ jobs:
strategy:
matrix:
include:
- namespace: application-loadbalancers
keywords: "application_load_balancer, target_group, application-load-balancer, target-group"
- namespace: user-management
keywords: "user, group, s3key, share"
- namespace: managed-backup
Expand Down
147 changes: 147 additions & 0 deletions docs/api/applicationloadbalancer/application_load_balancer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# application_load_balancer

This is a simple module that supports creating or removing Application Loadbalancers.

## Example Syntax


```yaml

- name: Create Application Load Balancer
application_load_balancer:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
name: "{{ name }}"
ips:
- "10.12.118.224"
listener_lan: "{{ listener_lan.lan.id }}"
target_lan: "{{ target_lan.lan.id }}"
wait: true
register: alb_response


- name: Update Application Load Balancer
application_load_balancer:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
name: "{{ name }} - UPDATE"
listener_lan: "{{ listener_lan.lan.id }}"
target_lan: "{{ target_lan.lan.id }}"
wait: true
state: update
register: alb_response_update


- name: Remove Application Load Balancer
application_load_balancer:
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
datacenter_id: "{{ datacenter_response.datacenter.id }}"
wait: true
state: absent

```
&nbsp;

&nbsp;

# state: **present**
```yaml

- name: Create Application Load Balancer
application_load_balancer:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
name: "{{ name }}"
ips:
- "10.12.118.224"
listener_lan: "{{ listener_lan.lan.id }}"
target_lan: "{{ target_lan.lan.id }}"
wait: true
register: alb_response

```
### Available parameters for state **present**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | True | str | | The name of the Application Load Balancer. |
| listener_lan | True | str | | ID of the listening LAN (inbound). |
| ips | False | list | | Collection of the Application Load Balancer IP addresses. (Inbound and outbound) IPs of the listenerLan must be customer-reserved IPs for public Load Balancers, and private IPs for private Load Balancers. |
| target_lan | True | str | | ID of the balanced private target LAN (outbound). |
| lb_private_ips | False | list | | Collection of private IP addresses with subnet mask of the Application Load Balancer. IPs must contain a valid subnet mask. If no IP is provided, the system will generate an IP with /24 subnet. |
| datacenter_id | True | str | | The ID of the datacenter. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
# state: **absent**
```yaml

- name: Remove Application Load Balancer
application_load_balancer:
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
datacenter_id: "{{ datacenter_response.datacenter.id }}"
wait: true
state: absent

```
### Available parameters for state **absent**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | False | str | | The name of the Application Load Balancer. |
| datacenter_id | True | str | | The ID of the datacenter. |
| application_load_balancer_id | False | str | | The ID of the Application Loadbalancer. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
# state: **update**
```yaml

- name: Update Application Load Balancer
application_load_balancer:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
name: "{{ name }} - UPDATE"
listener_lan: "{{ listener_lan.lan.id }}"
target_lan: "{{ target_lan.lan.id }}"
wait: true
state: update
register: alb_response_update

```
### Available parameters for state **update**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | True | str | | The name of the Application Load Balancer. |
| listener_lan | True | str | | ID of the listening LAN (inbound). |
| ips | False | list | | Collection of the Application Load Balancer IP addresses. (Inbound and outbound) IPs of the listenerLan must be customer-reserved IPs for public Load Balancers, and private IPs for private Load Balancers. |
| target_lan | True | str | | ID of the balanced private target LAN (outbound). |
| lb_private_ips | False | list | | Collection of private IP addresses with subnet mask of the Application Load Balancer. IPs must contain a valid subnet mask. If no IP is provided, the system will generate an IP with /24 subnet. |
| datacenter_id | True | str | | The ID of the datacenter. |
| application_load_balancer_id | False | str | | The ID of the Application Loadbalancer. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
153 changes: 153 additions & 0 deletions docs/api/applicationloadbalancer/application_load_balancer_flowlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# application_load_balancer_flowlog

This is a simple module that supports creating or removing Application Loadbalancer Flowlogs.

## Example Syntax


```yaml

- name: Create Application Load Balancer Flowlog
application_load_balancer_flowlog:
name: "{{ name }}"
action: "ACCEPTED"
direction: "INGRESS"
bucket: "sdktest"
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
wait: true
register: alb_flowlog_response


- name: Update Application Load Balancer Flowlog
application_load_balancer_flowlog:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
flowlog_id: "{{ alb_flowlog_response.flowlog.id }}"
name: "{{ name }}"
action: "ALL"
direction: "INGRESS"
bucket: "sdktest"
wait: true
state: update
register: alb_flowlog_update_response


- name: Delete Application Load Balancer Flowlog
application_load_balancer_flowlog:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
flowlog_id: "{{ alb_flowlog_response.flowlog.id }}"
state: absent

```
&nbsp;

&nbsp;

# state: **present**
```yaml

- name: Create Application Load Balancer Flowlog
application_load_balancer_flowlog:
name: "{{ name }}"
action: "ACCEPTED"
direction: "INGRESS"
bucket: "sdktest"
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
wait: true
register: alb_flowlog_response

```
### Available parameters for state **present**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | True | str | | The name of the flowlog. |
| action | True | str | | Specifies the traffic action pattern. |
| direction | True | str | | Specifies the traffic direction pattern. |
| bucket | True | str | | S3 bucket name of an existing IONOS Cloud S3 bucket. |
| datacenter_id | True | str | | The ID of the datacenter. |
| application_load_balancer_id | True | str | | The ID of the Application Loadbalancer. |
| flowlog_id | False | str | | The ID of the Flowlog. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
# state: **absent**
```yaml

- name: Delete Application Load Balancer Flowlog
application_load_balancer_flowlog:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
flowlog_id: "{{ alb_flowlog_response.flowlog.id }}"
state: absent

```
### Available parameters for state **absent**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | False | str | | The name of the flowlog. |
| datacenter_id | True | str | | The ID of the datacenter. |
| application_load_balancer_id | True | str | | The ID of the Application Loadbalancer. |
| flowlog_id | False | str | | The ID of the Flowlog. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
# state: **update**
```yaml

- name: Update Application Load Balancer Flowlog
application_load_balancer_flowlog:
datacenter_id: "{{ datacenter_response.datacenter.id }}"
application_load_balancer_id: "{{ alb_response.application_load_balancer.id }}"
flowlog_id: "{{ alb_flowlog_response.flowlog.id }}"
name: "{{ name }}"
action: "ALL"
direction: "INGRESS"
bucket: "sdktest"
wait: true
state: update
register: alb_flowlog_update_response

```
### Available parameters for state **update**:
&nbsp;

| Name | Required | Type | Default | Description |
| :--- | :---: | :--- | :--- | :--- |
| name | False | str | | The name of the flowlog. |
| action | False | str | | Specifies the traffic action pattern. |
| direction | False | str | | Specifies the traffic direction pattern. |
| bucket | False | str | | S3 bucket name of an existing IONOS Cloud S3 bucket. |
| datacenter_id | True | str | | The ID of the datacenter. |
| application_load_balancer_id | True | str | | The ID of the Application Loadbalancer. |
| flowlog_id | False | str | | The ID of the Flowlog. |
| api_url | False | str | | The Ionos API base URL. |
| username | True | str | | The Ionos username. Overrides the IONOS_USERNAME environment variable. |
| password | True | str | | The Ionos password. Overrides the IONOS_PASSWORD environment variable. |
| wait | False | bool | True | Wait for the resource to be created before returning. |
| wait_timeout | False | int | 600 | How long before wait gives up, in seconds. |
| state | False | str | present | Indicate desired state of the resource. |

&nbsp;

&nbsp;
Loading

0 comments on commit 0b11421

Please sign in to comment.