-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
61 lines (52 loc) · 1.38 KB
/
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
52
53
54
55
56
57
58
59
60
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.3.0"
}
}
}
provider "aws" {
profile = var.aws_profile
region = var.aws_region
}
# https://github.com/terraform-providers/terraform-provider-aws/issues/11409
resource "aws_ecs_cluster" "cluster" {
name = var.cluster_name
capacity_providers = ["FARGATE"]
default_capacity_provider_strategy {
capacity_provider = "FARGATE"
}
setting {
name = "containerInsights"
value = "disabled"
}
tags = {
Environment = var.tag_env
Contact = var.tag_cont
Cost = var.tag_cost
Customer = var.tag_cust
Project = var.tag_proj
Confidentiality = var.tag_conf
Compliance = var.tag_comp
Terraform = "true"
}
}
resource "aws_ecs_task_definition" "service" {
family = var.task_def_name
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = "256"
memory = "512"
container_definitions = file("task-definitions/service.json")
tags = {
Environment = var.tag_env
Contact = var.tag_cont
Cost = var.tag_cost
Customer = var.tag_cust
Project = var.tag_proj
Confidentiality = var.tag_conf
Compliance = var.tag_comp
Terraform = "true"
}
}