Skip to content

Commit 11b9ad4

Browse files
author
Eugene Dementyev
committed
Add README and define types for variables for clarity
1 parent c7d5540 commit 11b9ad4

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# terraform-aws-ecs-service
2+
3+
This module creates an ECS service. It supports load balanced services if required.
4+
5+
Has additional security measures that can be optionally enabled, such as RO filesystem, or "run as specified user".

variables.tf

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,59 @@
11
variable "cluster_name" {
22
description = "Name of the ECS cluster"
3+
type = string
34
}
45

56
variable "service_name" {
67
description = "Name of the ECS service"
8+
type = string
79
}
810

911
variable "target_group_name" {
1012
description = "Name of the ALB target group. Defaults to the `cluster_name` if not set"
13+
type = string
1114
default = ""
1215
}
1316

1417
variable "target_group_names" {
1518
description = "Names of the ALB target groups. Defaults to the `[cluster_name]` if not set"
19+
type = list(string)
1620
default = []
1721
}
1822

1923

2024
variable "environment" {
2125
description = "Enviropnment vars to pass to the container. Note: they will be visible in the task definition, so please don't pass any secrets here."
22-
type = map
26+
type = map(any)
2327
default = {}
2428

2529
}
2630

2731
variable "image" {
28-
description = "The image to use"
32+
description = "The Docker image to use"
33+
type = string
2934
}
3035

3136
variable "cpu" {
3237
description = "Amount of CPU to use"
38+
type = number
3339
default = 0
3440
}
3541

3642
variable "essential" {
3743
description = "Exit the task if contaner exits"
44+
type = bool
3845
default = true
3946
}
4047

4148
variable "memory" {
4249
description = "Amount of maximum memory the container can use"
50+
type = number
4351
default = 512
4452
}
4553

4654
variable "memory_reservation" {
4755
description = "Amount of reserved memory for the container"
56+
type = number
4857
default = 256
4958
}
5059

@@ -70,7 +79,7 @@ variable "task_role_arn" {
7079
}
7180

7281
variable "port_mappings" {
73-
type = list
82+
type = list(any)
7483
default = []
7584
}
7685

@@ -104,14 +113,14 @@ variable "desired_count" {
104113
}
105114

106115
variable "init_process_enabled" {
107-
type = bool
108116
description = "Use embdedded to Docker tini init process that correctly reaps zombie processes"
117+
type = bool
109118
default = true
110119
}
111120

112121
variable "user" {
113-
type = string
114122
description = "Run container as the specified user. Formats are: user, user:group, uid, uid:gid, user:gid, uid:group"
123+
type = string
115124
default = ""
116125
}
117126

0 commit comments

Comments
 (0)