Skip to content

Commit 168b96e

Browse files
authored
feat: HTTPS support! (#6)
* feat: Adds CloudFront and HTTPS support [WIP] * feat: Implements CloudFront in example, allows customization of Load Balancer Security Group, improves documentation, finishes HTTP support * chore: removes unnecessary setting in pre-commit-config * chore: removes unnecessary files and pre-commit hooks * chore: Sets oldest supported TF version to v1.1 * chore: Tries to fix pre-commit for minVersion * chore: Are you gonna work yet? * chore: restore pre-commit... * chore: updates versions * docs: Updates TF version requirement to 1.5
1 parent ca07567 commit 168b96e

File tree

10 files changed

+360
-215
lines changed

10 files changed

+360
-215
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
branches:
66
- main
7-
- master
87

98
env:
109
TERRAFORM_DOCS_VERSION: v0.16.0
@@ -96,4 +95,4 @@ jobs:
9695
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
9796
tflint-version: ${{ env.TFLINT_VERSION }}
9897
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
99-
install-hcledit: true
98+
install-hcledit: true

.pre-commit-config.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ repos:
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs
7-
args:
8-
- --args=--config=.terraform-docs.yml
9-
args:
10-
- '--args=--lockfile=false'
117
- id: terraform_tflint
128
args:
139
- '--args=--only=terraform_deprecated_interpolation'
@@ -25,9 +21,4 @@ repos:
2521
- '--args=--only=terraform_workspace_remote'
2622
- '--args=--only=terraform_unused_required_providers'
2723
- id: terraform_validate
28-
- repo: https://github.com/pre-commit/pre-commit-hooks
29-
rev: v4.6.0
30-
hooks:
31-
- id: check-merge-conflict
32-
- id: end-of-file-fixer
33-
- id: trailing-whitespace
24+

.terraform-docs.yml

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

README.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
# Terraform AWS Directus Module
1+
# Terraform AWS Directus Module 🚀
22

3-
This Terraform module deploys Directus on an AWS Fargate ECS cluster.
3+
This Terraform module simplifies the deployment of [Directus](https://directus.io/) on an AWS Fargate ECS cluster.
44

5-
## Usage
5+
## 🌟 Features
6+
7+
- **Seamless Deployment** of Directus on AWS Fargate ECS
8+
- **Automatic Scaling** and Load Balancing
9+
- **High Availability** and Fault Tolerance
10+
- **Customizable Configuration** Options
11+
- **S3 Integration** for Static Assets
12+
13+
## 🚀 Quick Start
14+
15+
Deploy Directus quickly and easily by including this module in your Terraform configuration:
616

717
```hcl
818
module "directus" {
@@ -55,55 +65,47 @@ module "directus" {
5565
tags = {
5666
Application = "Directus"
5767
Environment = "Test"
58-
} # Change these tags to your prefered tags
59-
68+
} # Change these tags to your preferred tags
69+
}
6070
```
6171

62-
For further information on a complete example (including all dependencies, such as database inputs) check [here](https://github.com/GiamPy5/terraform-aws-directus/tree/main/examples).
63-
64-
## Features
72+
For a complete example, including all dependencies like database inputs, check out the [examples](https://github.com/GiamPy5/terraform-aws-directus/tree/main/examples) section.
6573

66-
- Easy deployment of Directus on AWS Fargate ECS
67-
- Automatic scaling and load balancing
68-
- Highly available and fault-tolerant architecture
69-
- Customizable configuration options
70-
- S3 integration for static assets
74+
## 📋 Prerequisites
7175

72-
## To-Be-Done
76+
Before using this module, ensure you have the following:
7377

74-
- Implement Redis to allow multi-container deployment (currently only one is supported) (https://docs.directus.io/self-hosted/config-options.html#redis)
75-
- Implement Amazon Cognito authentication
76-
- HTTPS support
78+
- An **AWS account** 🛠️
79+
- **Terraform installed** on your machine 🌐
80+
- Basic knowledge of **AWS services** and **Terraform** 📚
7781

78-
## Prerequisites
82+
## 📅 Roadmap
7983

80-
Before using this module, make sure you have the following prerequisites:
84+
- [ ] Implement Amazon Cognito authentication
8185

82-
- AWS account
83-
- Terraform installed
84-
- Basic knowledge of AWS services and Terraform
86+
## 📚 Module Documentation
8587

86-
<!-- BEGIN_TF_DOCS -->
8788
## Requirements
8889

8990
| Name | Version |
9091
|------|---------|
91-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
92+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 |
9293
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.30 |
9394
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
9495

9596
## Providers
9697

9798
| Name | Version |
9899
|------|---------|
99-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.30 |
100-
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
100+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.54.1 |
101+
| <a name="provider_random"></a> [random](#provider\_random) | 3.6.2 |
101102

102103
## Modules
103104

104105
| Name | Source | Version |
105106
|------|--------|---------|
106107
| <a name="module_ecs"></a> [ecs](#module\_ecs) | terraform-aws-modules/ecs/aws | 5.11.2 |
108+
| <a name="module_s3_bucket_for_logs"></a> [s3\_bucket\_for\_logs](#module\_s3\_bucket\_for\_logs) | terraform-aws-modules/s3-bucket/aws | 4.1.2 |
107109

108110
## Resources
109111

@@ -122,8 +124,8 @@ Before using this module, make sure you have the following prerequisites:
122124
| [aws_iam_user.directus](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |
123125
| [aws_iam_user_policy.lb_ro](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy) | resource |
124126
| [aws_lb.directus](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb) | resource |
125-
| [aws_lb_listener.directus_lb_listener_http](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource |
126-
| [aws_lb_target_group.directus_lb_target_group_http](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
127+
| [aws_lb_listener.directus_lb_listener](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource |
128+
| [aws_lb_target_group.directus_lb_target_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
127129
| [aws_s3_bucket.directus](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
128130
| [aws_secretsmanager_secret.directus_admin_password](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource |
129131
| [aws_secretsmanager_secret.directus_secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource |
@@ -155,11 +157,14 @@ Before using this module, make sure you have the following prerequisites:
155157
| <a name="input_create_cloudwatch_logs_group"></a> [create\_cloudwatch\_logs\_group](#input\_create\_cloudwatch\_logs\_group) | Whether to create a CloudWatch Logs group | `bool` | `false` | no |
156158
| <a name="input_create_s3_bucket"></a> [create\_s3\_bucket](#input\_create\_s3\_bucket) | Whether to create an S3 bucket | `bool` | `false` | no |
157159
| <a name="input_ecs_service_enable_execute_command"></a> [ecs\_service\_enable\_execute\_command](#input\_ecs\_service\_enable\_execute\_command) | Whether to enable ECS service execute command | `bool` | `false` | no |
160+
| <a name="input_enable_alb_access_logs"></a> [enable\_alb\_access\_logs](#input\_enable\_alb\_access\_logs) | Whether to enable access logs of the Load Balancer | `bool` | `false` | no |
158161
| <a name="input_enable_ses_emails_sending"></a> [enable\_ses\_emails\_sending](#input\_enable\_ses\_emails\_sending) | Whether to enable sending emails using SES | `bool` | `false` | no |
159162
| <a name="input_force_new_ecs_deployment_on_apply"></a> [force\_new\_ecs\_deployment\_on\_apply](#input\_force\_new\_ecs\_deployment\_on\_apply) | Whether to force a new deployment of the ECS service on apply | `bool` | `false` | no |
160-
| <a name="input_healthcheck_path"></a> [healthcheck\_path](#input\_healthcheck\_path) | The path of the healthcheck endpoint | `string` | `"/server/ping"` | no |
161163
| <a name="input_image_tag"></a> [image\_tag](#input\_image\_tag) | The tag of the Docker image | `string` | `"latest"` | no |
164+
| <a name="input_load_balancer_allowed_cidr_blocks"></a> [load\_balancer\_allowed\_cidr\_blocks](#input\_load\_balancer\_allowed\_cidr\_blocks) | The CIDR blocks allowed to access the Load Balancer | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
165+
| <a name="input_load_balancer_prefix_list_ids"></a> [load\_balancer\_prefix\_list\_ids](#input\_load\_balancer\_prefix\_list\_ids) | The prefix list IDs allowed to access the Load Balancer | `list(string)` | `[]` | no |
162166
| <a name="input_memory"></a> [memory](#input\_memory) | The amount of memory to reserve for the Directus service | `number` | `4096` | no |
167+
| <a name="input_public_url"></a> [public\_url](#input\_public\_url) | The public URL of the Directus service | `string` | `""` | no |
163168
| <a name="input_rds_database_engine"></a> [rds\_database\_engine](#input\_rds\_database\_engine) | The engine of the RDS database | `string` | n/a | yes |
164169
| <a name="input_rds_database_host"></a> [rds\_database\_host](#input\_rds\_database\_host) | The host of the RDS database | `string` | n/a | yes |
165170
| <a name="input_rds_database_name"></a> [rds\_database\_name](#input\_rds\_database\_name) | The Name of the RDS database | `string` | n/a | yes |
@@ -170,6 +175,7 @@ Before using this module, make sure you have the following prerequisites:
170175
| <a name="input_redis_port"></a> [redis\_port](#input\_redis\_port) | The port of the Redis server | `number` | `6379` | no |
171176
| <a name="input_redis_username"></a> [redis\_username](#input\_redis\_username) | The username of the Redis server | `string` | `"default"` | no |
172177
| <a name="input_s3_bucket_name"></a> [s3\_bucket\_name](#input\_s3\_bucket\_name) | The name of the S3 bucket | `string` | `""` | no |
178+
| <a name="input_ssl_certificate_arn"></a> [ssl\_certificate\_arn](#input\_ssl\_certificate\_arn) | The ARN of the SSL certificate | `string` | `""` | no |
173179
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | The IDs of the subnets | `list(string)` | n/a | yes |
174180
| <a name="input_tags"></a> [tags](#input\_tags) | The tags to apply to the resources | `map(string)` | `{}` | no |
175181
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The ID of the VPC | `string` | n/a | yes |
@@ -179,14 +185,15 @@ Before using this module, make sure you have the following prerequisites:
179185
| Name | Description |
180186
|------|-------------|
181187
| <a name="output_load_balancer_dns_name"></a> [load\_balancer\_dns\_name](#output\_load\_balancer\_dns\_name) | The DNS name of the load balancer |
188+
| <a name="output_load_balancer_listener_arn"></a> [load\_balancer\_listener\_arn](#output\_load\_balancer\_listener\_arn) | The ARN of the load balancer listener |
189+
| <a name="output_load_balancer_target_group_arn"></a> [load\_balancer\_target\_group\_arn](#output\_load\_balancer\_target\_group\_arn) | The ARN of the load balancer target group |
182190
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the S3 bucket |
183191
| <a name="output_s3_bucket_name"></a> [s3\_bucket\_name](#output\_s3\_bucket\_name) | The name of the S3 bucket |
184-
<!-- END_TF_DOCS -->
185192

186-
## Contributing
193+
## 🤝 Contributing
187194

188-
Contributions to this module are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
195+
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/GiamPy5/terraform-aws-directus).
189196

190-
## License
197+
## 📄 License
191198

192199
This module is open source and available under the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)