You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform Module for AWS ECS by the SourceFuse ARC team.
8
+
SourceFuse's AWS Reference Architecture Terraform module leverages the terraform-aws-modules/terraform-aws-ecs GitHub repository to facilitate the deployment and management of an AWS ECS (Elastic Container Service) cluster. It streamlines the configuration of ECS tasks, services, and related components, providing a scalable and efficient solution for orchestrating containerized applications. With customizable settings for logging, load balancing, and service discovery, the module promotes seamless deployment and management of containerized workloads on AWS.
9
9
10
10
The module assumes that upstream dependencies, namely networking dependencies, are created upstream and the values are passed into this module via mechanisms such as Terraform data source queries.
11
11
@@ -20,17 +20,48 @@ The module provisions
20
20
* Utilizes ACM to generate a certificate specific to the ALB.
21
21
* Tags/SSM params - the module tags resources and outputs SSM params that can be used in data source lookups downstream for ECS services to reference to deploy into the cluster.
Our approach to ECS Fargate clusters is to provision a cluster and allow downstream services to attach to it via convention based data source queries.
26
27
27
-
**Note**: the example below is does not have a pinned version. Be sure to pin your version. Refer to the `example` folder for a working example version.
28
-
## Usage
28
+
### Prerequisites
29
+
Before using this module, ensure you have the following:
30
+
31
+
- AWS credentials configured.
32
+
- Terraform installed.
33
+
- A working knowledge of Terraform.
34
+
- Route 53 hosted zone
35
+
- Network
36
+
37
+
38
+
## Getting Started
39
+
40
+
1.**Define the Module**
41
+
42
+
Initially, it's essential to define a Terraform module, which is organized as a distinct directory encompassing Terraform configuration files. Within this module directory, input variables and output values must be defined in the variables.tf and outputs.tf files, respectively. The following illustrates an example directory structure:
43
+
44
+
45
+
```plaintext
46
+
ecs/
47
+
|-- main.tf
48
+
|-- variables.tf
49
+
|-- outputs.tf
50
+
```
51
+
52
+
53
+
2.**Define Input Variables**
54
+
55
+
Inside the `variables.tf` or in `*.tfvars` file, you should define values for the variables that the module requires.
56
+
57
+
3.**Use the Module in Your Main Configuration**
58
+
In your main Terraform configuration file (e.g., main.tf), you can use the module. Specify the source of the module, and version, For Example
59
+
29
60
30
61
```hcl
31
62
module "ecs" {
32
-
source = "sourcefuse/arc-ecs/aws"
33
-
version = "1.3.7"
63
+
source = "sourcefuse/arc-ecs/aws"
64
+
version = "1.5.2"
34
65
35
66
environment = var.environment
36
67
namespace = var.namespace
@@ -46,7 +77,8 @@ module "ecs" {
46
77
// -------------------------- END ------------------------- //
47
78
48
79
## create acm certificate and dns record for health check
Inside the `outputs.tf` file of the module, you can define output values that can be referenced in the main configuration. For example:
99
+
100
+
```hcl
101
+
output "cluster_name" {
102
+
description = "Name of the ECS Cluster"
103
+
value = module.ecs.cluster_name
104
+
}
105
+
106
+
output "health_check_fqdn" {
107
+
description = "Health check FQDN record created in Route 53."
108
+
value = module.ecs.health_check_fqdn
109
+
}
110
+
```
111
+
112
+
5.**Execute Terraform Commands**
113
+
114
+
After defining your main configuration, navigate to the directory containing your Terraform files and run the following commands:
115
+
116
+
117
+
```bash
118
+
terraform init
119
+
terraform apply
120
+
```
121
+
122
+
6.**Review and Confirm**
123
+
124
+
Terraform will display a plan showing the changes it intends to make. Review the plan and confirm by typing 'yes' when prompted.
125
+
64
126
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
65
127
## Requirements
66
128
@@ -188,6 +250,18 @@ You can append to this array by adding values to `var.additional_ssm_params`.
188
250
189
251
## Development
190
252
253
+
### Versioning
254
+
255
+
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
256
+
257
+
For Example
258
+
259
+
```sh
260
+
git commit -m "your commit message #major"
261
+
```
262
+
By specifying this , it will bump the version and if you don't specify this in your commit message then by default it will consider patch and will bump that accordingly
@@ -203,17 +277,6 @@ You can append to this array by adding values to `var.additional_ssm_params`.
203
277
pre-commit install
204
278
```
205
279
206
-
### Git commits
207
-
208
-
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
209
-
210
-
For Example
211
-
212
-
```sh
213
-
git commit -m "your commit message #major"
214
-
```
215
-
By specifying this , it will bump the version and if you don't specify this in your commit message then by default it will consider patch and will bump that accordingly
0 commit comments