|
| 1 | +# Terraform AWS ARC (Load Balancer) Module Usage Guide |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +### Purpose of the Document |
| 6 | + |
| 7 | +This document outlines guidelines and instructions for users implementing the Terraform module for AWS Load Balance |
| 8 | + |
| 9 | +### Module Overview |
| 10 | + |
| 11 | +The [terraform-aws-arc-load-balancer](https://github.com/sourcefuse/terraform-aws-arc-load-balancer) to implement Terraform module for setting up an AWS Load Balancer |
| 12 | + |
| 13 | +### Prerequisites |
| 14 | + |
| 15 | +Before using this module, ensure you have the following: |
| 16 | + |
| 17 | +- AWS credentials configured. |
| 18 | +- Terraform installed. |
| 19 | +- A working knowledge of AWS VPC, S3, Load balancer and Terraform concepts. |
| 20 | + |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +### Module Source |
| 24 | + |
| 25 | +To use the module in your Terraform configuration, include the following source block: |
| 26 | + |
| 27 | +```hcl |
| 28 | +module "alb" { |
| 29 | + source = "sourcefuse/arc-load-balancer/aws" |
| 30 | + version = "0.0.1" |
| 31 | + load_balancer_config = local.load_balancer_config |
| 32 | + target_group_config = local.target_group_config |
| 33 | + target_group_attachment_config = local.target_group_attachment_config |
| 34 | + alb_listener = local.alb_listener |
| 35 | + default_action = local.default_action |
| 36 | + listener_rules = local.listener_rules |
| 37 | + security_group_data = local.security_group_data |
| 38 | + security_group_name = local.security_group_name |
| 39 | + vpc_id = data.aws_vpc.default.id |
| 40 | + tags = module.tags.tags |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +Refer to the [Terraform Registry](https://registry.terraform.io/modules/sourcefuse/arc-load-balancer/aws/latest) for the latest version. |
| 45 | + |
| 46 | +### Integration with Existing Terraform Configurations |
| 47 | + |
| 48 | +Refer to the Terraform Registry for the latest version. |
| 49 | + |
| 50 | +## Integration with Existing Terraform Configurations |
| 51 | +Integrate the module with your existing Terraform mono repo configuration, follow the steps below: |
| 52 | + |
| 53 | +- Create a new folder in terraform/ named load-balancer. |
| 54 | +- Create the required files, see the [example](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/tree/main/example) |
| 55 | +to base off of. |
| 56 | +- Configure with your backend: |
| 57 | + - **region**: Where the backend resides |
| 58 | + - **key**: `<working_directory>/terraform.tfstate` |
| 59 | + - **bucket**: Bucket name where the terraform state will reside |
| 60 | + - **dynamodb_table**: Lock table so there are not duplicate tfplans in the mix |
| 61 | + - **encrypt**: Encrypt all traffic to and from the backend |
| 62 | + |
| 63 | +### Required AWS Permissions |
| 64 | + |
| 65 | +Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create, list and modify: |
| 66 | + |
| 67 | +- Load balancer |
| 68 | +- s3 |
| 69 | + |
| 70 | + |
| 71 | +## Module Configuration |
| 72 | + |
| 73 | +### Input Variables |
| 74 | + |
| 75 | +For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-load-balancer#inputs) section. |
| 76 | + |
| 77 | +### Output Values |
| 78 | + |
| 79 | +For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-load-balancer?tab=readme-ov-file#outputs) section. |
| 80 | + |
| 81 | +## Module Usage |
| 82 | + |
| 83 | +### Basic Usage |
| 84 | + |
| 85 | +For basic usage, see the [example](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/tree/main/example) folder. |
| 86 | + |
| 87 | +This example will create: |
| 88 | + |
| 89 | +- ALB: An Application Load Balancer for handling HTTP/HTTPS traffic at Layer 7 (Application). |
| 90 | +- Security Group: To control access to the ALB and associated backend services. |
| 91 | +- Subnets: To ensure high availability across multiple Availability Zones. |
| 92 | +- CloudWatch Logs: For logging requests and responses passing through the ALB. |
| 93 | +- A Network Load Balancer for handling TCP traffic at Layer 4 (Transport) |
| 94 | + |
| 95 | +### Tips and Recommendations |
| 96 | + |
| 97 | +- The module focuses on provisioning Load Balancer. The convention-based approach enables downstream services to easily attach to the Load Balancer. Adjust the configuration parameters as needed for your specific use case. |
| 98 | + |
| 99 | +## Troubleshooting |
| 100 | + |
| 101 | +### Reporting Issues |
| 102 | + |
| 103 | +If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/issues). |
| 104 | + |
| 105 | +## Security Considerations |
| 106 | + |
| 107 | +### AWS VPC |
| 108 | + |
| 109 | +Understand the security considerations related to Load Balancer on AWS when using this module. |
| 110 | + |
| 111 | +### Best Practices for AWS Load Balancer |
| 112 | + |
| 113 | +Follow best practices to ensure secure Security configurations: |
| 114 | + |
| 115 | +- [AWS Load Balancer Security Best Practices]() |
| 116 | + |
| 117 | +## Contributing and Community Support |
| 118 | + |
| 119 | +### Contributing Guidelines |
| 120 | + |
| 121 | +Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/blob/main/CONTRIBUTING.md) file. |
| 122 | + |
| 123 | +### Reporting Bugs and Issues |
| 124 | + |
| 125 | +If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/issues). |
| 126 | + |
| 127 | +## License |
| 128 | + |
| 129 | +### License Information |
| 130 | + |
| 131 | +This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-load-balancer/blob/main/LICENSE) file for more details. |
| 132 | + |
| 133 | +### Open Source Contribution |
| 134 | + |
| 135 | +Contribute to open source by using and enhancing this module. Your contributions are welcome! |
0 commit comments