Skip to content

Commit d4580df

Browse files
authored
Merge pull request #52 from manikanta-sadurla/feature/update-document
Updated Document
2 parents 8e0b3d1 + cde5b21 commit d4580df

File tree

1 file changed

+80
-17
lines changed

1 file changed

+80
-17
lines changed

README.md

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Known Vulnerabilities](https://github.com/sourcefuse/terraform-aws-arc-ecs/actions/workflows/snyk.yaml/badge.svg)](https://github.com/sourcefuse/terraform-aws-arc-ecs/actions/workflows/snyk.yaml)
66
## Overview
77

8-
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.
99

1010
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.
1111

@@ -20,17 +20,48 @@ The module provisions
2020
* Utilizes ACM to generate a certificate specific to the ALB.
2121
* 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.
2222

23+
2324
![Module Structure](./static/arc_ecs_basic_components.png)
2425

2526
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.
2627

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+
2960

3061
```hcl
3162
module "ecs" {
32-
source = "sourcefuse/arc-ecs/aws"
33-
version = "1.3.7"
63+
source = "sourcefuse/arc-ecs/aws"
64+
version = "1.5.2"
3465
3566
environment = var.environment
3667
namespace = var.namespace
@@ -46,7 +77,8 @@ module "ecs" {
4677
// -------------------------- END ------------------------- //
4778
4879
## create acm certificate and dns record for health check
49-
route_53_zone = local.route_53_zone
80+
route_53_zone_name = var.route_53_zone
81+
route_53_zone_id = data.aws_route53_zone.this.id
5082
acm_domain_name = "healthcheck-ecs-${var.namespace}-${var.environment}.${local.route_53_zone}"
5183
acm_subject_alternative_names = []
5284
health_check_route_53_records = [
@@ -61,6 +93,36 @@ module "ecs" {
6193
}
6294
```
6395

96+
4. **Output Values**
97+
98+
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+
64126
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
65127
## Requirements
66128

@@ -188,6 +250,18 @@ You can append to this array by adding values to `var.additional_ssm_params`.
188250

189251
## Development
190252

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
263+
264+
191265
### Prerequisites
192266

193267
- [terraform](https://learn.hashicorp.com/terraform/getting-started/install#installing-terraform)
@@ -203,17 +277,6 @@ You can append to this array by adding values to `var.additional_ssm_params`.
203277
pre-commit install
204278
```
205279

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
216-
217280
### Tests
218281
- Tests are available in `test` directory
219282
- Configure the dependencies

0 commit comments

Comments
 (0)