Skip to content

Commit

Permalink
feat: initial release of terraform-aws-global-accelerator module
Browse files Browse the repository at this point in the history
🎉
  • Loading branch information
bryantbiggs committed Jan 27, 2022
1 parent f66c7b1 commit 87c047e
Show file tree
Hide file tree
Showing 11 changed files with 605 additions and 44 deletions.
132 changes: 119 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,94 @@
# AWS <TODO_EXPANDED> Terraform module
# AWS Global Accelerator Terraform module

Terraform module which creates AWS <TODO_EXPANDED> resources.
Terraform module which creates AWS Global Accelerator resources.

## Usage

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

```hcl
module "<TODO_UNDER>" {
source = "clowdhaus/<TODO>/aws"
module "global_accelerator" {
source = "clowdhaus/global-accelerator/aws"
name = "example"
flow_logs_enabled = true
flow_logs_s3_bucket = "example-global-accelerator-flow-logs"
flow_logs_s3_prefix = "example"
listeners = {
listener_1 = {
client_affinity = "SOURCE_IP"
endpoint_group = {
health_check_port = 80
health_check_protocol = "HTTP"
health_check_path = "/"
health_check_interval_seconds = 10
health_check_timeout_seconds = 5
healthy_threshold_count = 2
unhealthy_threshold_count = 2
traffic_dial_percentage = 100
endpoint_configuration = [{
client_ip_preservation_enabled = true
endpoint_id = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/blue/1234567890123456"
weight = 50
}, {
client_ip_preservation_enabled = false
endpoint_id = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/green/1234567890123456"
weight = 50
}]
port_override = [{
endpoint_port = 82
listener_port = 80
}, {
endpoint_port = 8082
listener_port = 8080
}, {
endpoint_port = 8083
listener_port = 8081
}]
}
port_ranges = [
{
from_port = 80
to_port = 81
},
{
from_port = 8080
to_port = 8081
}
]
protocol = "TCP"
}
listener_2 = {
port_ranges = [
{
from_port = 443
to_port = 443
},
{
from_port = 8443
to_port = 8443
}
]
protocol = "TCP"
}
listener_3 = {
port_ranges = [
{
from_port = 53
to_port = 53
}
]
protocol = "UDP"
}
}
tags = {
Terraform = "true"
Expand All @@ -19,39 +99,65 @@ module "<TODO_UNDER>" {

## Examples

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!
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!

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

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

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.30 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.33 |

## Providers

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

## Modules

No modules.

## Resources

No resources.
| Name | Type |
|------|------|
| [aws_globalaccelerator_accelerator.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_accelerator) | resource |
| [aws_globalaccelerator_endpoint_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_endpoint_group) | resource |
| [aws_globalaccelerator_listener.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/globalaccelerator_listener) | resource |

## Inputs

No inputs.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no |
| <a name="input_create_listeners"></a> [create\_listeners](#input\_create\_listeners) | Controls if listeners should be created (affects only listeners) | `bool` | `true` | no |
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false` | `bool` | `true` | no |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <a name="input_listeners"></a> [listeners](#input\_listeners) | A map of listener defintions to create | `any` | `{}` | no |
| <a name="input_listeners_timeouts"></a> [listeners\_timeouts](#input\_listeners\_timeouts) | Create, update, and delete timeout configurations for the listeners | `map(string)` | `{}` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the accelerator | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_dns_name"></a> [dns\_name](#output\_dns\_name) | The DNS name of the accelerator |
| <a name="output_endpoint_groups"></a> [endpoint\_groups](#output\_endpoint\_groups) | Map of endpoints created and their associated attributes |
| <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 |
| <a name="output_id"></a> [id](#output\_id) | The Amazon Resource Name (ARN) of the accelerator |
| <a name="output_ip_sets"></a> [ip\_sets](#output\_ip\_sets) | IP address set associated with the accelerator |
| <a name="output_listeners"></a> [listeners](#output\_listeners) | Map of listeners created and their associated attributes |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## License

Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-<TODO>/blob/main/LICENSE).
Apache-2.0 Licensed. See [LICENSE](https://github.com/clowdhaus/terraform-aws-global-accelerator/blob/main/LICENSE).
17 changes: 0 additions & 17 deletions eject.sh

This file was deleted.

4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Terraform AWS <TODO_EXPANDED> Examples
# Terraform AWS Global Accelerator Examples

- [Complete](https://github.com/clowdhaus/terraform-aws-<TODO>/tree/main/examples/complete)
- [Complete](https://github.com/clowdhaus/terraform-aws-global-accelerator/tree/main/examples/complete)
36 changes: 28 additions & 8 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Complete AWS <TODO> Example
# Complete AWS Global Accelerator Example

Configuration in this directory creates:

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

## Usage

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

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

## Providers

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

## Modules

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

## Resources

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

## Inputs

No inputs.

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_dns_name"></a> [dns\_name](#output\_dns\_name) | The DNS name of the accelerator |
| <a name="output_endpoint_groups"></a> [endpoint\_groups](#output\_endpoint\_groups) | Map of endpoints created and their associated attributes |
| <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 |
| <a name="output_id"></a> [id](#output\_id) | The Amazon Resource Name (ARN) of the accelerator |
| <a name="output_ip_sets"></a> [ip\_sets](#output\_ip\_sets) | IP address set associated with the accelerator |
| <a name="output_listeners"></a> [listeners](#output\_listeners) | Map of listeners created and their associated attributes |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

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

0 comments on commit 87c047e

Please sign in to comment.