Skip to content

Commit a908331

Browse files
committed
feat: add resource
1 parent 090dade commit a908331

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

more_examples/main.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ module "eks" {
5858
}
5959
}
6060

61+
resource "aws_ecs_task_definition" "my_task" {
62+
family = "my-task"
63+
requires_compatibilities = ["FARGATE"]
64+
network_mode = "awsvpc"
65+
cpu = "1024" # 1 vCPU
66+
memory = "2048" # 2 GB
67+
execution_role_arn = "aws_iam_role.ecs_task_execution_role.arn"
68+
69+
container_definitions = jsonencode([
70+
{
71+
name = "task-container"
72+
image = "public.ecr.aws/nginx:latest"
73+
essential = true
74+
portMappings = [
75+
{
76+
containerPort = 80
77+
hostPort = 80
78+
protocol = "tcp"
79+
}
80+
]
81+
}
82+
])
83+
}
84+
6185
provider "azurerm" {
6286
skip_provider_registration = true
6387
features {}
@@ -76,3 +100,4 @@ resource "azurerm_log_analytics_workspace" "azure_app2_logs" {
76100
resource_group_name = "example-rg"
77101
sku = "PerGB2018"
78102
}
103+

0 commit comments

Comments
 (0)