Error: InvalidParameterException: Task Definition can not be blank. │ #25025
Unanswered
JyotiPorwal
asked this question in
Q&A
Replies: 2 comments
-
This is the CDK repo, which is unrelated to terraform. Please seek out support from terraform |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Guys, I have imported my current aws infra to terraform and want to run this on new aws account. I'm getting error while running Terraform plan- Error: InvalidParameterException: Task Definition can not be blank.
│
│ with aws_ecs_task_definition.prod-app-server-task,
│ on versions.tf line 78, in resource "aws_ecs_task_definition" "prod-app-server-task":
│ 78: resource "aws_ecs_task_definition" "prod-app-server-task" {
resource "aws_ecs_service" "prod-app-server-service" {
cluster = "arn:aws:ecs:ap-northeast-1:************:cluster/prod-app-server"
deployment_maximum_percent = 200
deployment_minimum_healthy_percent = 100
desired_count = 1
enable_ecs_managed_tags = true
enable_execute_command = false
health_check_grace_period_seconds = 60
iam_role = "aws-service-role"
name = "prod-app-server-service"
platform_version = "LATEST"
scheduling_strategy = "REPLICA"
tags = {}
tags_all = {}
task_definition = "prod-app-server-task"
capacity_provider_strategy {
base = 0
capacity_provider = "FARGATE"
weight = 1
}
deployment_circuit_breaker {
enable = true
rollback = true
}
deployment_controller {
type = "ECS"
}
load_balancer {
container_name = "prod-app-server-con"
container_port = 5000
target_group_arn = "arn:aws:elasticloadbalancing:ap-northeast-1:************:targetgroup/prod-app-server-tg/6e59f3a567a189fc"
}
network_configuration {
assign_public_ip = true
security_groups = [
"sg-00fea10a8c14e4eba",
]
subnets = [
"subnet-09ff4e75458413a73",
"subnet-0aea940e2b5f16e54",
]
}
} resource "aws_ecs_task_definition" "prod-app-server-task" {
family = "my-ecs-task-family"
container_definitions = jsonencode(
{ cpu = 0 environment = [
essential = true
image = ".dkr.ecr.ap-south-1.amazonaws.com/terraform"
logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-create-group = "true"
awslogs-group = "/ecs/prod-app-server-task"
awslogs-region = "eu-west-2"
awslogs-stream-prefix = "ecs"
}
}
mountPoints = []
name = "prod-app-server-con"
portMappings = [
{
appProtocol = "http"
containerPort = 5000
hostPort = 5000
name = "prod-app-server-con"
protocol = "tcp"
},
]
volumesFrom = []
},
]
)
cpu = "1024"
execution_role_arn = "arn:aws:iam:::role/ecsTaskExecutionRole"
memory = "2048"
network_mode = "awsvpc"
requires_compatibilities = [
"FARGATE",
]
tags = {
"ecs:taskDefinition:createdFrom" = "ecs-console-v2"
}
tags_all = {
"ecs:taskDefinition:createdFrom" = "ecs-console-v2"
}
task_role_arn = "arn:aws:iam::************:role/ecsTaskExecutionRole"
runtime_platform {
cpu_architecture = "X86_64"
operating_system_family = "LINUX"
}
}
Beta Was this translation helpful? Give feedback.
All reactions