rover icon indicating copy to clipboard operation
rover copied to clipboard

Dependencies in configuration blocks are not shown

Open teru01 opened this issue 2 years ago • 1 comments

When referencing other resources in the configuration block of a resource block, dependencies on those resources are not displayed.

Example: define aws_ecs_service as follows

resource "aws_ecs_service" "example" {
  name                              = "ecs-sample-service"
  cluster                           = aws_ecs_cluster.example.arn
  task_definition                   = aws_ecs_task_definition.example.arn
  desired_count                     = 1
  launch_type                       = "FARGATE"
  platform_version                  = "1.4.0"
  health_check_grace_period_seconds = 60
  enable_execute_command            = true

  network_configuration {
    assign_public_ip = false
    security_groups  = [module.ecs_app_sg.security_group_id]

    subnets = [
      aws_subnet.private_0.id,
      aws_subnet.private_1.id,
    ]
  }

  load_balancer {
    target_group_arn = aws_lb_target_group.example.arn
    container_name   = "ecs-sample-app"
    container_port   = 80
  }
}

Visualizing this definition would look like this

image

There should be dependencies on the security group in the network_configuration block and the target_group in the load_balancer block, but they are not shown. On the other hand, dependencies on cluster and task_definition, which are written directly under the resource block, are shown.

Another example: define aws_lb_listener_rule as follows

resource "aws_lb_listener_rule" "example" {
  listener_arn = aws_lb_listener.http.arn
  priority     = 100

  action {
    type             = "forward"
    target_group_arn = aws_lb_target_group.example.arn
  }
}

Similar to the above example, the visualization of this definition does not show the dependency on target_group in the action block

image

Thank you.

teru01 avatar May 24 '22 14:05 teru01

I see this also with depends_on block, does not render any explicit dependencies declared in that block.

crispinboylan-int avatar Jul 13 '22 08:07 crispinboylan-int