Skip to content

Commit 87c047e

Browse files
committed
feat: initial release of terraform-aws-global-accelerator module
🎉
1 parent f66c7b1 commit 87c047e

File tree

11 files changed

+605
-44
lines changed

11 files changed

+605
-44
lines changed

README.md

Lines changed: 119 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,94 @@
1-
# AWS <TODO_EXPANDED> Terraform module
1+
# AWS Global Accelerator Terraform module
22

3-
Terraform module which creates AWS <TODO_EXPANDED> resources.
3+
Terraform module which creates AWS Global Accelerator resources.
44

55
## Usage
66

7-
See [`examples`](https://github.com/clowdhaus/terraform-aws-<TODO>/tree/main/examples) directory for working examples to reference:
7+
See [`examples`](https://github.com/clowdhaus/terraform-aws-global-accelerator/tree/main/examples) directory for working examples to reference:
88

99
```hcl
10-
module "<TODO_UNDER>" {
11-
source = "clowdhaus/<TODO>/aws"
10+
module "global_accelerator" {
11+
source = "clowdhaus/global-accelerator/aws"
12+
13+
name = "example"
14+
15+
flow_logs_enabled = true
16+
flow_logs_s3_bucket = "example-global-accelerator-flow-logs"
17+
flow_logs_s3_prefix = "example"
18+
19+
listeners = {
20+
listener_1 = {
21+
client_affinity = "SOURCE_IP"
22+
23+
endpoint_group = {
24+
health_check_port = 80
25+
health_check_protocol = "HTTP"
26+
health_check_path = "/"
27+
health_check_interval_seconds = 10
28+
health_check_timeout_seconds = 5
29+
healthy_threshold_count = 2
30+
unhealthy_threshold_count = 2
31+
traffic_dial_percentage = 100
32+
33+
endpoint_configuration = [{
34+
client_ip_preservation_enabled = true
35+
endpoint_id = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/blue/1234567890123456"
36+
weight = 50
37+
}, {
38+
client_ip_preservation_enabled = false
39+
endpoint_id = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/green/1234567890123456"
40+
weight = 50
41+
}]
42+
43+
port_override = [{
44+
endpoint_port = 82
45+
listener_port = 80
46+
}, {
47+
endpoint_port = 8082
48+
listener_port = 8080
49+
}, {
50+
endpoint_port = 8083
51+
listener_port = 8081
52+
}]
53+
}
54+
55+
port_ranges = [
56+
{
57+
from_port = 80
58+
to_port = 81
59+
},
60+
{
61+
from_port = 8080
62+
to_port = 8081
63+
}
64+
]
65+
protocol = "TCP"
66+
}
67+
68+
listener_2 = {
69+
port_ranges = [
70+
{
71+
from_port = 443
72+
to_port = 443
73+
},
74+
{
75+
from_port = 8443
76+
to_port = 8443
77+
}
78+
]
79+
protocol = "TCP"
80+
}
81+
82+
listener_3 = {
83+
port_ranges = [
84+
{
85+
from_port = 53
86+
to_port = 53
87+
}
88+
]
89+
protocol = "UDP"
90+
}
91+
}
1292
1393
tags = {
1494
Terraform = "true"
@@ -19,39 +99,65 @@ module "<TODO_UNDER>" {
1999

20100
## Examples
21101

22-
Examples codified under the [`examples`](https://github.com/clowdhaus/terraform-aws-<TODO>/tree/main/examples) are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!
102+
Examples codified under the [`examples`](https://github.com/clowdhaus/terraform-aws-global-accelerator/tree/main/examples) are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!
23103

24-
- [Complete](https://github.com/clowdhaus/terraform-aws-<TODO>/tree/main/examples/complete)
104+
- [Complete](https://github.com/clowdhaus/terraform-aws-global-accelerator/tree/main/examples/complete)
25105

26106
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
27107
## Requirements
28108

29109
| Name | Version |
30110
|------|---------|
31111
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
32-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.30 |
112+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.33 |
33113

34114
## Providers
35115

36-
No providers.
116+
| Name | Version |
117+
|------|---------|
118+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.33 |
37119

38120
## Modules
39121

40122
No modules.
41123

42124
## Resources
43125

44-
No resources.
126+
| Name | Type |
127+
|------|------|
128+
| [aws_globalaccelerator_accelerator.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_accelerator) | resource |
129+
| [aws_globalaccelerator_endpoint_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_endpoint_group) | resource |
130+
| [aws_globalaccelerator_listener.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_listener) | resource |
45131

46132
## Inputs
47133

48-
No inputs.
134+
| Name | Description | Type | Default | Required |
135+
|------|-------------|------|---------|:--------:|
136+
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no |
137+
| <a name="input_create_listeners"></a> [create\_listeners](#input\_create\_listeners) | Controls if listeners should be created (affects only listeners) | `bool` | `true` | no |
138+
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false` | `bool` | `true` | no |
139+
| <a name="input_endpoint_groups_timeouts"></a> [endpoint\_groups\_timeouts](#input\_endpoint\_groups\_timeouts) | Create, update, and delete timeout configurations for the endpoint groups | `map(string)` | `{}` | no |
140+
| <a name="input_flow_logs_enabled"></a> [flow\_logs\_enabled](#input\_flow\_logs\_enabled) | Indicates whether flow logs are enabled. Defaults to `false` | `bool` | `false` | no |
141+
| <a name="input_flow_logs_s3_bucket"></a> [flow\_logs\_s3\_bucket](#input\_flow\_logs\_s3\_bucket) | The name of the Amazon S3 bucket for the flow logs. Required if `flow_logs_enabled` is `true` | `string` | `null` | no |
142+
| <a name="input_flow_logs_s3_prefix"></a> [flow\_logs\_s3\_prefix](#input\_flow\_logs\_s3\_prefix) | The prefix for the location in the Amazon S3 bucket for the flow logs. Required if `flow_logs_enabled` is `true` | `string` | `null` | no |
143+
| <a name="input_ip_address_type"></a> [ip\_address\_type](#input\_ip\_address\_type) | The value for the address type. Defaults to `IPV4`. Valid values: `IPV4` | `string` | `"IPV4"` | no |
144+
| <a name="input_listeners"></a> [listeners](#input\_listeners) | A map of listener defintions to create | `any` | `{}` | no |
145+
| <a name="input_listeners_timeouts"></a> [listeners\_timeouts](#input\_listeners\_timeouts) | Create, update, and delete timeout configurations for the listeners | `map(string)` | `{}` | no |
146+
| <a name="input_name"></a> [name](#input\_name) | The name of the accelerator | `string` | `""` | no |
147+
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
49148

50149
## Outputs
51150

52-
No outputs.
151+
| Name | Description |
152+
|------|-------------|
153+
| <a name="output_dns_name"></a> [dns\_name](#output\_dns\_name) | The DNS name of the accelerator |
154+
| <a name="output_endpoint_groups"></a> [endpoint\_groups](#output\_endpoint\_groups) | Map of endpoints created and their associated attributes |
155+
| <a name="output_hosted_zone_id"></a> [hosted\_zone\_id](#output\_hosted\_zone\_id) | The Global Accelerator Route 53 zone ID that can be used to route an Alias Resource Record Set to the Global Accelerator |
156+
| <a name="output_id"></a> [id](#output\_id) | The Amazon Resource Name (ARN) of the accelerator |
157+
| <a name="output_ip_sets"></a> [ip\_sets](#output\_ip\_sets) | IP address set associated with the accelerator |
158+
| <a name="output_listeners"></a> [listeners](#output\_listeners) | Map of listeners created and their associated attributes |
53159
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
54160

55161
## License
56162

57-
Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-<TODO>/blob/main/LICENSE).
163+
Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-global-accelerator/blob/main/LICENSE).

eject.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Terraform AWS <TODO_EXPANDED> Examples
1+
# Terraform AWS Global Accelerator Examples
22

3-
- [Complete](https://github.com/clowdhaus/terraform-aws-<TODO>/tree/main/examples/complete)
3+
- [Complete](https://github.com/clowdhaus/terraform-aws-global-accelerator/tree/main/examples/complete)

examples/complete/README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Complete AWS <TODO> Example
1+
# Complete AWS Global Accelerator Example
22

33
Configuration in this directory creates:
44

5-
- <XXX>
5+
- A standard Global Accelerator
6+
- Multiple listeners
7+
- An endpoint group for one of the listeners with multiple endpoints
68

79
## Usage
810

@@ -11,6 +13,7 @@ To run this example you need to execute:
1113
```bash
1214
$ terraform init
1315
$ terraform plan
16+
$ terraform apply --target module.vpc --target module.alb # In order to reference ALB ARN as a target endpoint
1417
$ terraform apply
1518
```
1619

@@ -22,27 +25,44 @@ Note that this example may create resources which will incur monetary charges on
2225
| Name | Version |
2326
|------|---------|
2427
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.30 |
28+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.33 |
2629

2730
## Providers
2831

29-
No providers.
32+
| Name | Version |
33+
|------|---------|
34+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.33 |
3035

3136
## Modules
3237

33-
No modules.
38+
| Name | Source | Version |
39+
|------|--------|---------|
40+
| <a name="module_alb"></a> [alb](#module\_alb) | terraform-aws-modules/alb/aws | ~> 6.0 |
41+
| <a name="module_global_accelerator"></a> [global\_accelerator](#module\_global\_accelerator) | ../.. | n/a |
42+
| <a name="module_global_accelerator_disabled"></a> [global\_accelerator\_disabled](#module\_global\_accelerator\_disabled) | ../.. | n/a |
43+
| <a name="module_s3_log_bucket"></a> [s3\_log\_bucket](#module\_s3\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2.0 |
44+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 3.0 |
3445

3546
## Resources
3647

37-
No resources.
48+
| Name | Type |
49+
|------|------|
50+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
3851

3952
## Inputs
4053

4154
No inputs.
4255

4356
## Outputs
4457

45-
No outputs.
58+
| Name | Description |
59+
|------|-------------|
60+
| <a name="output_dns_name"></a> [dns\_name](#output\_dns\_name) | The DNS name of the accelerator |
61+
| <a name="output_endpoint_groups"></a> [endpoint\_groups](#output\_endpoint\_groups) | Map of endpoints created and their associated attributes |
62+
| <a name="output_hosted_zone_id"></a> [hosted\_zone\_id](#output\_hosted\_zone\_id) | The Global Accelerator Route 53 zone ID that can be used to route an Alias Resource Record Set to the Global Accelerator |
63+
| <a name="output_id"></a> [id](#output\_id) | The Amazon Resource Name (ARN) of the accelerator |
64+
| <a name="output_ip_sets"></a> [ip\_sets](#output\_ip\_sets) | IP address set associated with the accelerator |
65+
| <a name="output_listeners"></a> [listeners](#output\_listeners) | Map of listeners created and their associated attributes |
4666
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4767

48-
Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-<TODO>/blob/main/LICENSE).
68+
Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-global-accelerator/blob/main/LICENSE).

0 commit comments

Comments
 (0)