Skip to content

Commit c8aa7ee

Browse files
committed
feat(modules): ecs cluster
1 parent e0e6136 commit c8aa7ee

File tree

6 files changed

+103
-0
lines changed

6 files changed

+103
-0
lines changed

modules/cluster/.header.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# cluster

modules/cluster/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN_TF_DOCS -->
2+
# cluster
3+
4+
## Requirements
5+
6+
| Name | Version |
7+
|------|---------|
8+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6.0 |
9+
10+
## Providers
11+
12+
| Name | Version |
13+
|------|---------|
14+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.59.0 |
15+
16+
## Modules
17+
18+
No modules.
19+
20+
## Resources
21+
22+
| Name | Type |
23+
|------|------|
24+
| [aws_ecs_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_cluster) | resource |
25+
26+
## Inputs
27+
28+
| Name | Description | Type | Default | Required |
29+
|------|-------------|------|---------|:--------:|
30+
| <a name="input_name"></a> [name](#input\_name) | Name of the ECS Cluster to create | `string` | n/a | yes |
31+
| <a name="input_setting"></a> [setting](#input\_setting) | Details of the setting configuration | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
32+
| <a name="input_tags"></a> [tags](#input\_tags) | Resource Tags for ECS Cluster | `map(any)` | `{}` | no |
33+
34+
## Outputs
35+
36+
| Name | Description |
37+
|------|-------------|
38+
| <a name="output_arn"></a> [arn](#output\_arn) | ARN of the ECS Cluster |
39+
| <a name="output_id"></a> [id](#output\_id) | Identifier of the ECS Cluster |
40+
| <a name="output_name"></a> [name](#output\_name) | Name of the ECS Cluster |
41+
<!-- END_TF_DOCS -->

modules/cluster/main.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
################################################################################
2+
# ECS Cluster
3+
################################################################################
4+
5+
resource "aws_ecs_cluster" "this" {
6+
name = var.name
7+
8+
configuration {
9+
execute_command_configuration {
10+
logging = "NONE"
11+
}
12+
}
13+
14+
dynamic "setting" {
15+
for_each = var.setting
16+
iterator = setting
17+
18+
content {
19+
name = setting.value.name
20+
value = setting.value.value
21+
}
22+
}
23+
24+
tags = var.tags
25+
}

modules/cluster/outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
output "id" {
2+
description = "Identifier of the ECS Cluster"
3+
value = aws_ecs_cluster.this.id
4+
}
5+
6+
output "arn" {
7+
description = "ARN of the ECS Cluster"
8+
value = aws_ecs_cluster.this.arn
9+
}
10+
11+
output "name" {
12+
description = "Name of the ECS Cluster"
13+
value = var.name
14+
}

modules/cluster/variables.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
variable "name" {
2+
description = "Name of the ECS Cluster to create"
3+
type = string
4+
}
5+
6+
variable "setting" {
7+
description = "Details of the setting configuration"
8+
type = list(object({
9+
name = string
10+
value = string
11+
}))
12+
default = []
13+
}
14+
15+
variable "tags" {
16+
description = "Resource Tags for ECS Cluster"
17+
type = map(any)
18+
default = {}
19+
}

modules/cluster/version.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
terraform {
2+
required_version = ">= 1.6.0"
3+
}

0 commit comments

Comments
 (0)