terraform-aws-ecs icon indicating copy to clipboard operation
terraform-aws-ecs copied to clipboard

subnet_ids not optional

Open jam01 opened this issue 3 weeks ago β€’ 0 comments

Description

subnet_ids is declared as optional, but is required per the implementation, leading to an error.

  • [x] βœ‹ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]:

  • Terraform version: v1.13.4

  • Provider version(s): v6.22.0

Reproduction Code [Required]

Not adding subnet_ids

Expected behavior

Create the task-definition

Actual behavior

Error result

Terminal Output Screenshot(s)

β”‚ Error: Error in function call
β”‚ 
β”‚   on .terraform/modules/ecs_job_dbmigration/modules/service/main.tf line 1875, in data "aws_subnet" "this":
β”‚ 1875:   id = element(var.subnet_ids, 0)
β”‚     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     β”‚ while calling element(list, index)
β”‚     β”‚ var.subnet_ids is empty list of string
β”‚ 
β”‚ Call to function "element" failed: cannot use element function with an
β”‚ empty list.

jam01 avatar Nov 27 '25 02:11 jam01