-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from alrayyes/feat/load-balancer-listener-res…
…ource feat: implement load balancer listener resource
- Loading branch information
Showing
9 changed files
with
1,279 additions
and
3 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,86 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "leaseweb_public_cloud_load_balancer_listener Resource - leaseweb" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# leaseweb_public_cloud_load_balancer_listener (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
# Manage non HTTPS example Public Cloud load balancer listener | ||
resource "leaseweb_public_cloud_load_balancer_listener" "example" { | ||
protocol = "HTTP" | ||
port = 80 | ||
default_rule = { | ||
target_group_id = "b05917e1-96a4-442a-900c-c41f273d95c9" | ||
} | ||
load_balancer_id = "695ddd91-051f-4dd6-9120-938a927a47d0" | ||
} | ||
# Manage HTTPS example Public Cloud load balancer listener | ||
resource "leaseweb_public_cloud_load_balancer_listener" "example2" { | ||
protocol = "HTTPS" | ||
port = 443 | ||
certificate = { | ||
certificate = "-----BEGIN CERTIFICATE-----MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtWdKNbZxvkXKAADjJMJ7VTJz6uFoMD403C+gMIF8hwqIsHggzCao6iXrW9sZoyZtUBVBiiq5RumHbbpwvOdMmXrShEB4sTJkWRMDy7yD4D91WCU1fc10E/zBJMwssAvmHZo5kGW1Pj1N9ktb+O/TMsEc6yd5suvdQj6aaJbQlTQIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAWOQ2CJLRo8MQgJgvhdoSIkHITnrbjB5hS3f/dx0lIcnyI6Q9nOyuQHXkCgkdBaV8lz7l+IbqcGc3CaIRP2ZIVFvo2252n630tOOSsqoqJS1tYIoIKsohi3T3d8T1i/s0BWbTJi8Xgd186wyUn/jHwXROKx2rq6yYsAO6fISDKw8=-----END CERTIFICATE-----" | ||
private_key = "-----BEGIN EC PRIVATE KEY-----MIHcAgEBBEIBVlC0IObonfQZIQ81l/WILKfWT5Fv96eNnYmQZ7uleu73igfiVESVuPfNlbW9oNEK1XcXli4YNZMxWMkKuzC3w8CgBwYFK4EEACOhgYkDgYYABAHvOqz9d2xeSpm1FNdw0NR5j/q6PMd6whZFsTPNYNj0/PsTpsHk78ZB4MYnJUXwHJjpj+gnKkLNc02f4w/vSF8VXADX4l40XU/w82TAOCftQwoxO5o0jZcwEUIYzl02Zd7uNxhjtKJQnYFi9x8WI8L8zQ6GZB/fJKYwoHaUr0I1h/5LzQ==-----END EC PRIVATE KEY-----" | ||
} | ||
default_rule = { | ||
target_group_id = "b05917e1-96a4-442a-900c-c41f273d95c9" | ||
} | ||
load_balancer_id = "695ddd91-051f-4dd6-9120-938a927a47d0" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `default_rule` (Attributes) (see [below for nested schema](#nestedatt--default_rule)) | ||
- `load_balancer_id` (String) Load balancer ID | ||
- `port` (Number) Port that the listener listens to | ||
- `protocol` (String) Valid options are | ||
- *HTTP* | ||
- *HTTPS* | ||
- *TCP* | ||
|
||
### Optional | ||
|
||
- `certificate` (Attributes) Required only if protocol is HTTPS (see [below for nested schema](#nestedatt--certificate)) | ||
|
||
### Read-Only | ||
|
||
- `listener_id` (String) Listener ID | ||
|
||
<a id="nestedatt--default_rule"></a> | ||
### Nested Schema for `default_rule` | ||
|
||
Optional: | ||
|
||
- `target_group_id` (String) Client Private Key. Required only if protocol is `HTTPS` | ||
|
||
|
||
<a id="nestedatt--certificate"></a> | ||
### Nested Schema for `certificate` | ||
|
||
Optional: | ||
|
||
- `certificate` (String, Sensitive) Client Certificate. Required only if protocol is `HTTPS` | ||
- `chain` (String, Sensitive) CA certificate. Not required, but can be added if protocol is `HTTPS` | ||
- `private_key` (String, Sensitive) Client Private Key. Required only if protocol is `HTTPS` | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# Public Cloud load balancer listener can be imported by passing "load_balancer_id,listener_id". | ||
terraform import leaseweb_public_cloud_load_balancer_listener.example 695ddd91-051f-4dd6-9120-938a927a47d0,695ddd91-051f-4dd6-9120-938a927a47d0 | ||
``` |
2 changes: 2 additions & 0 deletions
2
examples/resources/leaseweb_public_cloud_load_balancer_listener/import.sh
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 @@ | ||
# Public Cloud load balancer listener can be imported by passing "load_balancer_id,listener_id". | ||
terraform import leaseweb_public_cloud_load_balancer_listener.example 695ddd91-051f-4dd6-9120-938a927a47d0,695ddd91-051f-4dd6-9120-938a927a47d0 |
23 changes: 23 additions & 0 deletions
23
examples/resources/leaseweb_public_cloud_load_balancer_listener/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,23 @@ | ||
# Manage non HTTPS example Public Cloud load balancer listener | ||
resource "leaseweb_public_cloud_load_balancer_listener" "example" { | ||
protocol = "HTTP" | ||
port = 80 | ||
default_rule = { | ||
target_group_id = "b05917e1-96a4-442a-900c-c41f273d95c9" | ||
} | ||
load_balancer_id = "695ddd91-051f-4dd6-9120-938a927a47d0" | ||
} | ||
|
||
# Manage HTTPS example Public Cloud load balancer listener | ||
resource "leaseweb_public_cloud_load_balancer_listener" "example2" { | ||
protocol = "HTTPS" | ||
port = 443 | ||
certificate = { | ||
certificate = "-----BEGIN CERTIFICATE-----MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtWdKNbZxvkXKAADjJMJ7VTJz6uFoMD403C+gMIF8hwqIsHggzCao6iXrW9sZoyZtUBVBiiq5RumHbbpwvOdMmXrShEB4sTJkWRMDy7yD4D91WCU1fc10E/zBJMwssAvmHZo5kGW1Pj1N9ktb+O/TMsEc6yd5suvdQj6aaJbQlTQIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAWOQ2CJLRo8MQgJgvhdoSIkHITnrbjB5hS3f/dx0lIcnyI6Q9nOyuQHXkCgkdBaV8lz7l+IbqcGc3CaIRP2ZIVFvo2252n630tOOSsqoqJS1tYIoIKsohi3T3d8T1i/s0BWbTJi8Xgd186wyUn/jHwXROKx2rq6yYsAO6fISDKw8=-----END CERTIFICATE-----" | ||
private_key = "-----BEGIN EC PRIVATE KEY-----MIHcAgEBBEIBVlC0IObonfQZIQ81l/WILKfWT5Fv96eNnYmQZ7uleu73igfiVESVuPfNlbW9oNEK1XcXli4YNZMxWMkKuzC3w8CgBwYFK4EEACOhgYkDgYYABAHvOqz9d2xeSpm1FNdw0NR5j/q6PMd6whZFsTPNYNj0/PsTpsHk78ZB4MYnJUXwHJjpj+gnKkLNc02f4w/vSF8VXADX4l40XU/w82TAOCftQwoxO5o0jZcwEUIYzl02Zd7uNxhjtKJQnYFi9x8WI8L8zQ6GZB/fJKYwoHaUr0I1h/5LzQ==-----END EC PRIVATE KEY-----" | ||
} | ||
default_rule = { | ||
target_group_id = "b05917e1-96a4-442a-900c-c41f273d95c9" | ||
} | ||
load_balancer_id = "695ddd91-051f-4dd6-9120-938a927a47d0" | ||
} |
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
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.