kokospapa8 / ecs-fargate-sample-app

django sample app for ecs fargate deployment
Apache License 2.0
12 stars 10 forks source link

error on aws_instance creation: Call to function "element" failed #3

Closed kbroughton closed 3 years ago

kbroughton commented 4 years ago

Hi there! Thanks for this project. I was trying to run it, but I keep hitting the error below. I'm familiar with terraform, but finding it more difficult to debug the terragrunt output. Any ideas?

Error: Error in function call

on main.tf line 12, in resource "aws_instance" "this": 12: subnet_id = length(var.network_interface) > 0 ? null : element( 13: 14: 15: |---------------- | count.index is 0 | var.subnet_id is "" | var.subnet_ids is empty list of string

Call to function "element" failed: cannot use element function with an empty list.

kokospapa8 commented 4 years ago

Hi, I just saw this issue opened now. I will try to fix it, meanwhile can refer to cloudformation stack or manually setup the environment? It would take some time for me to fix it.

kokospapa8 commented 3 years ago

@kbroughton Hi, I replace terraform and cloudformation to AWS CDK. Please refer to following doc