-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add resource
cloudavenue_alb_virtual_service
chore: enhancement testacc feat: Add datasource `cloudavenue_alb_virtual_service`
- Loading branch information
David MICHENEAU
committed
Dec 2, 2024
1 parent
540a9e7
commit ec1c2a3
Showing
27 changed files
with
3,014 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-note:feature | ||
`resource/cloudavenue_alb_virtual_service` - New resource for managing ALB virtual service. | ||
``` | ||
|
||
```release-note:feature | ||
`datasource/cloudavenue_alb_virtual_service` - New datasource to read ALB virtual service. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,5 +181,6 @@ linters-settings: | |
"NAT", | ||
"VPN", | ||
"BMS", | ||
"SAML" | ||
"SAML", | ||
"ALB" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cloudavenue_alb_virtual_service Data Source - cloudavenue" | ||
subcategory: "" | ||
description: |- | ||
Provides a VMware Cloud Director edge gateway load balancer virtual server data source | ||
--- | ||
|
||
# cloudavenue_alb_virtual_service (Data Source) | ||
|
||
Provides a VMware Cloud Director edge gateway load balancer virtual server data source | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the ALB Virtual Service. | ||
|
||
### Optional | ||
|
||
- `certificate_id` (String) The ID of the certificate. The certificate must be uploaded to the NSX Advanced Load Balancer before it can be used. The certificate MUST'NT be expired. | ||
- `description` (String) The description of the ALB Virtual Service. | ||
- `edge_gateway_id` (String) The ID of the edge gateway on which the ALB Virtual Service is to be created. | ||
- `edge_gateway_name` (String) The name of the edge gateway on which the ALB Virtual Service is to be created. | ||
- `enabled` (Boolean) Defines if the ALB Virtual Service is enabled. | ||
- `pool_id` (String) The ID of the ALB Server Pool associated. | ||
- `pool_name` (String) The name of the ALB Server Pool associated. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the virtual service. | ||
- `service_engine_group_name` (String) The name of the service Engine Group (Take the first one if not specified). | ||
- `service_ports` (Attributes List) The service port of the ALB Virtual Service. The service port is the port on which the virtual service listens for client traffic. (see [below for nested schema](#nestedatt--service_ports)) | ||
- `service_type` (String) . | ||
- `virtual_ip` (String) The virtual IP address of the ALB Virtual Service. | ||
|
||
<a id="nestedatt--service_ports"></a> | ||
### Nested Schema for `service_ports` | ||
|
||
Read-Only: | ||
|
||
- `port_end` (Number) The end port of the service port range. If not specified, only the `port_start` value is used. | ||
- `port_ssl` (Boolean) Defines if the service port is SSL enabled. | ||
- `port_start` (Number) The start port of the service port range or exact port number if `port_end`is not set. | ||
- `port_type` (String) The type of the service port. The different modes that the NSX Advanced Load Balancer supports for handling TCP traffic and various parameters that can be tuned for optimization of the TCP traffic are also detailed here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
page_title: "cloudavenue_alb_virtual_service Resource - cloudavenue" | ||
subcategory: "ALB (Advanced Load Balancer)" | ||
description: |- | ||
Provides a resource to manage ALB Virtual services in CloudAvenue. A virtual service advertises an IP address and ports to the external world and listens for client traffic. When a virtual service receives traffic, it directs it to members in ALB Pool. | ||
--- | ||
|
||
# cloudavenue_alb_virtual_service (Resource) | ||
|
||
Provides a resource to manage ALB Virtual services in CloudAvenue. A virtual service advertises an IP address and ports to the external world and listens for client traffic. When a virtual service receives traffic, it directs it to members in ALB Pool. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "cloudavenue_edgegateway" "example" { | ||
name = "tn01e02ocb0006205spt101" | ||
} | ||
resource "cloudavenue_alb_pool" "example" { | ||
edge_gateway_id = data.cloudavenue_edgegateway.example.id | ||
name = "albpool-name" | ||
persistence_profile = { | ||
type = "CLIENT_IP" | ||
} | ||
members = [ | ||
{ | ||
ip_address = "192.168.99.11" | ||
port = "80" | ||
}, | ||
{ | ||
ip_address = "192.168.10.2" | ||
port = "80" | ||
}, | ||
{ | ||
ip_address = "192.168.1.3" | ||
port = "80" | ||
} | ||
] | ||
health_monitors = ["TCP"] | ||
} | ||
resource "cloudavenue_alb_virtual_service" "example" { | ||
name = "albvs-name" | ||
description = "description" | ||
edge_gateway_id = data.cloudavenue_edgegateway.example.id | ||
enabled = true | ||
pool_id = cloudavenue_alb_pool.example.id | ||
virtual_ip = "192.168.10.10" | ||
certificate_id = "urn:vcloud:certificateLibraryItem:f9caac3a-2555-477e-ae58-0740687d4daf" | ||
service_type = "HTTPS" | ||
service_ports = [ | ||
{ | ||
port_start = 443 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
}, | ||
{ | ||
port_start = 8080 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
}, | ||
{ | ||
port_start = 8088 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the ALB Virtual Service. | ||
- `service_ports` (Attributes List) The service port of the ALB Virtual Service. The service port is the port on which the virtual service listens for client traffic. (see [below for nested schema](#nestedatt--service_ports)) | ||
- `service_type` (String) . Value must be one of: `HTTP` (If you choose "HTTP" you don't need to set the "port_type" and "ssl_enabled" attribute in "service_ports".), `HTTPS` (If you choose "HTTPS", you must provide a certificate ID and you don't need to set the "port_type" attribute in "service_ports".), `L4` (If you choose "L4", you can set a service "port_type" attribute in "service_ports.), `L4_TLS` (If you choose "L4_TLS", you must provide a certificate ID and you can set a service "port_type" attribute in "service_ports.). | ||
- `virtual_ip` (String) The virtual IP address of the ALB Virtual Service. | ||
|
||
### Optional | ||
|
||
- `certificate_id` (String) The ID of the certificate. The certificate must be uploaded to the NSX Advanced Load Balancer before it can be used. The certificate MUST'NT be expired. If the value of [`<.service_type`](#<.service_type) attribute is one of `L4_TLS` or `HTTPS` this attribute is **REQUIRED**. If the value of [`<.service_ports[*].port_ssl`](#<.service_ports[*].port_ssl) attribute is `true` this attribute is **REQUIRED**. | ||
- `description` (String) The description of the ALB Virtual Service. | ||
- `edge_gateway_id` (String) (ForceNew) The ID of the edge gateway on which the ALB Virtual Service is to be created. Ensure that one and only one attribute from this collection is set : `edge_gateway_name`, `edge_gateway_id`. | ||
- `edge_gateway_name` (String) (ForceNew) The name of the edge gateway on which the ALB Virtual Service is to be created. Ensure that one and only one attribute from this collection is set : `edge_gateway_name`, `edge_gateway_id`. | ||
- `enabled` (Boolean) Defines if the ALB Virtual Service is enabled. | ||
- `pool_id` (String) The ID of the ALB Server Pool associated. Ensure that one and only one attribute from this collection is set : `pool_name`, `pool_id`. | ||
- `pool_name` (String) The name of the ALB Server Pool associated. Ensure that one and only one attribute from this collection is set : `pool_name`, `pool_id`. | ||
- `service_engine_group_name` (String) The name of the service Engine Group (Take the first one if not specified). | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the virtual service. | ||
|
||
<a id="nestedatt--service_ports"></a> | ||
### Nested Schema for `service_ports` | ||
|
||
Required: | ||
|
||
- `port_start` (Number) The start port of the service port range or exact port number if `port_end`is not set. | ||
|
||
Optional: | ||
|
||
- `port_end` (Number) The end port of the service port range. If not specified, only the `port_start` value is used. | ||
- `port_ssl` (Boolean) Defines if the service port is SSL enabled. Value defaults to `false`. | ||
- `port_type` (String) The type of the service port. The different modes that the NSX Advanced Load Balancer supports for handling TCP traffic and various parameters that can be tuned for optimization of the TCP traffic are also detailed here. Value must be one of: `TCP_PROXY` (The TCP proxy terminates client connections to the virtual service, processes the payload, and then opens a new TCP connection to the destination server. Any application data from the client that is destined for a server is forwarded to that server over the new server-side TCP connection. Separating (or proxying) the client-to-server connections enables the NSX Advanced Load Balancer to provide enhanced security, such as TCP protocol sanitization and denial of service (DoS) mitigation.), `TCP_FAST_PATH` (A TCP fast path profile does not proxy TCP connections. It directly connects clients to the destination server and translates the destination virtual service address of the client with the IP address of the chosen destination server. The source IP address of the client can be NATed to the IP address of the SE.), `UDP_FAST_PATH` (NSX Advanced Load Balancer translates the client’s destination virtual service address to the destination server and writes the source IP address of the client to the address of the SE, when forwarding the packet to the server. This ensures that server response traffic traverses symmetrically through the original SE.). If the value of [`service_type`](#service_type) attribute is `L4` this attribute is **REQUIRED**. If the value of [`service_type`](#service_type) attribute is one of `HTTP`, `HTTPS` or `L4_TLS` this attribute is **NULL**. Value defaults to `TCP_PROXY`. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
```shell | ||
# use the edge_gateway_name.alb_pool_name to import the ALB Pool | ||
terraform import cloudavenue_alb_virtual_service.test edge_gateway_nameOrID.alb_virtual_service_name | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# use the edge_gateway_name.alb_pool_name to import the ALB Pool | ||
terraform import cloudavenue_alb_virtual_service.test edge_gateway_nameOrID.alb_virtual_service_name |
53 changes: 53 additions & 0 deletions
53
examples/resources/cloudavenue_alb_virtual_service/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
data "cloudavenue_edgegateway" "example" { | ||
name = "tn01e02ocb0006205spt101" | ||
} | ||
|
||
resource "cloudavenue_alb_pool" "example" { | ||
edge_gateway_id = data.cloudavenue_edgegateway.example.id | ||
name = "albpool-name" | ||
persistence_profile = { | ||
type = "CLIENT_IP" | ||
} | ||
members = [ | ||
{ | ||
ip_address = "192.168.99.11" | ||
port = "80" | ||
}, | ||
{ | ||
ip_address = "192.168.10.2" | ||
port = "80" | ||
}, | ||
{ | ||
ip_address = "192.168.1.3" | ||
port = "80" | ||
} | ||
] | ||
health_monitors = ["TCP"] | ||
} | ||
resource "cloudavenue_alb_virtual_service" "example" { | ||
name = "albvs-name" | ||
description = "description" | ||
edge_gateway_id = data.cloudavenue_edgegateway.example.id | ||
enabled = true | ||
pool_id = cloudavenue_alb_pool.example.id | ||
virtual_ip = "192.168.10.10" | ||
certificate_id = "urn:vcloud:certificateLibraryItem:f9caac3a-2555-477e-ae58-0740687d4daf" | ||
service_type = "HTTPS" | ||
service_ports = [ | ||
{ | ||
port_start = 443 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
}, | ||
{ | ||
port_start = 8080 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
}, | ||
{ | ||
port_start = 8088 | ||
port_type = "TCP_PROXY" | ||
port_ssl = true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.