-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
51 lines (38 loc) · 913 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Variables.
*/
variable "name" {
description = "Task definition name"
}
variable "container_definitions" {
description = "here you should include the full container definitons"
default = "[]"
}
variable "task_role" {
description = "Optional IAM role that tasks can use to make API requests to authorized AWS services."
default = ""
}
/**
* Resources.
*/
# The ECS task definition.
resource "aws_ecs_task_definition" "main" {
family = "${var.name}"
task_role_arn = "${var.task_role}"
container_definitions = "${var.container_definitions}"
}
/**
* Outputs.
*/
// The created task definition name
output "name" {
value = "${aws_ecs_task_definition.main.family}"
}
// The created task definition ARN
output "arn" {
value = "${aws_ecs_task_definition.main.arn}"
}
// The created task definition ARN
output "revision" {
value = "${aws_ecs_task_definition.main.revision}"
}