{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/22349","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/22349/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/22349/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/22349/events","html_url":"https://github.com/hashicorp/terraform/issues/22349","id":477395391,"node_id":"MDU6SXNzdWU0NzczOTUzOTE=","number":22349,"title":"Terraform Crash Error: rpc error: code = Unavailable desc = transport is closing","user":{"login":"Geartrixy","id":29755594,"node_id":"MDQ6VXNlcjI5NzU1NTk0","avatar_url":"https://avatars3.githubusercontent.com/u/29755594?v=4","gravatar_id":"","url":"https://api.github.com/users/Geartrixy","html_url":"https://github.com/Geartrixy","followers_url":"https://api.github.com/users/Geartrixy/followers","following_url":"https://api.github.com/users/Geartrixy/following{/other_user}","gists_url":"https://api.github.com/users/Geartrixy/gists{/gist_id}","starred_url":"https://api.github.com/users/Geartrixy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Geartrixy/subscriptions","organizations_url":"https://api.github.com/users/Geartrixy/orgs","repos_url":"https://api.github.com/users/Geartrixy/repos","events_url":"https://api.github.com/users/Geartrixy/events{/privacy}","received_events_url":"https://api.github.com/users/Geartrixy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-08-06T13:53:40Z","updated_at":"2019-08-06T13:53:40Z","closed_at":null,"author_association":"NONE","body":"\r\n\r\n### Terraform Version\r\n<!---\r\nRun `terraform -v` to show the version, and paste the result between the ``` marks below.\r\n\r\nIf you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed.\r\n-->\r\n\r\n```\r\n0.12.6 / 2.22.0\r\n```\r\n\r\n### Terraform Configuration Files (Child Module)\r\n\r\n\r\n```hcl\r\nresource \"aws_lb_listener\" \"http\" {\r\n  count             = (var.lb_http_listener == true ? 1 : 0)\r\n  load_balancer_arn = aws_lb.application_loadbalancer.arn\r\n  port              = var.lb_http_listener_port\r\n  protocol          = \"HTTP\"\r\n\r\n  default_action {\r\n    target_group_arn = aws_lb_target_group.tg_http[0].arn\r\n    type             = \"forward\"\r\n  }\r\n}\r\n\r\n# Create http listener rules\r\nresource \"aws_lb_listener_rule\" \"http\" {\r\n  count              = (var.lb_http_listener == true ? length(var.host_headers) == length(var.http_target_group_names) ? length(var.host_headers) : 0 : 0)\r\n  listener_arn       = aws_lb_listener.http[0].arn\r\n\r\n  action {\r\n    type             = \"forward\"\r\n    target_group_arn = element(aws_lb_target_group.tg_http.*.arn, count.index)\r\n  }\r\n\r\n  condition {\r\n    field            = \"host-header\"\r\n    values           = [element(var.host_headers, count.index)]\r\n  }\r\n}\r\n\r\nresource \"aws_lb_listener\" \"https\" {\r\n  count              = var.lb_https_listener == true ? 1 : 0\r\n  load_balancer_arn  = aws_lb.application_loadbalancer.arn\r\n  port               = var.lb_https_listener_port\r\n  protocol           = \"HTTPS\"\r\n\r\n  default_action {\r\n    target_group_arn = var.lb_https_offloading == true ? aws_lb_target_group.tg_http[0].arn : aws_lb_target_group.tg_https[0].arn\r\n    type             = \"forward\"\r\n  }\r\n\r\n  certificate_arn    = var.certificate_arn\r\n}\r\n\r\n# Create https listener rules\r\nresource \"aws_lb_listener_rule\" \"https\" {\r\n  count              = (var.lb_https_listener == true ? length(var.host_headers) == length(var.https_target_group_names) ? length(var.host_headers) : 0 : 0)\r\n  listener_arn       = aws_lb_listener.https[0].arn\r\n\r\n  action {\r\n    type             = \"forward\"\r\n    target_group_arn = var.lb_https_offloading == true ?  element(aws_lb_target_group.tg_http.*.arn, count.index) : element(aws_lb_target_group.tg_https.*.arn, count.index)\r\n  }\r\n\r\n  condition {\r\n    field            = \"host-header\"\r\n    values           = [element(var.host_headers, count.index)]\r\n  }\r\n}\r\n\r\nresource \"aws_lb\" \"application_loadbalancer\" {\r\n  ### Required Arguments ###\r\n  name               = \"${var.prefix}${var.lb_name}${var.suffix}\"\r\n  internal           = var.lb_internal\r\n  load_balancer_type = \"application\"\r\n  # at least 2 subnets must be specified\r\n  subnets            = local.lb_subnet_ids\r\n  # if no security group is specified, \"default\" will be assigned\r\n  security_groups    = concat(local.lb_security_groups)\r\n\r\n  idle_timeout               = var.lb_idle_timeout\r\n  enable_http2               = var.lb_enable_http2\r\n  enable_deletion_protection = var.lb_enable_deletion_protection\r\n}\r\n\r\nresource \"aws_lb_target_group\" \"tg_http\" {\r\n  # Check the number of http target group names matches the number of http target group ports.\r\n  # If check is ok creates the number of http target group resources based on the number of http target group names\r\n  count = var.lb_http_listener == true ? length(var.http_target_group_names) == length(var.http_target_group_ports) ? length(var.http_target_group_names) : 0 : 0\r\n\r\n  ### Required Arguments ###\r\n  name     = \"${var.prefix}${element(var.http_target_group_names, count.index)}${var.suffix}\" # default prefix/suffix = \"\". Default target group name = [\"http-target-group\"] N.B. 32 Character limit with prefix/suffix\r\n  port     = element(var.http_target_group_ports, count.index)                                # default = [80]\r\n  protocol = \"HTTP\"\r\n  vpc_id   = var.vpc_id\r\n\r\n  health_check {\r\n    interval            = var.http_health_check_interval            #default = 30\r\n    path                = var.http_health_check_path                #default = \"/\"\r\n    port                = var.http_health_check_port                #default = \"traffic-port\"\r\n    protocol            = \"HTTP\"\r\n    timeout             = var.http_health_check_timeout             #default = 5\r\n    healthy_threshold   = var.http_health_check_healthy_threshold   #default = 3\r\n    unhealthy_threshold = var.http_health_check_unhealthy_threshold #default = 3\r\n    matcher             = var.http_health_check_matcher             #default = 200\r\n  }\r\n\r\n  target_type = \"instance\"\r\n\r\n  ### Optional Arguments ###\r\n  deregistration_delay = var.http_target_group_deregistration_delay # default = 300.\r\n\r\n  stickiness {\r\n    enabled         = var.http_target_group_stickiness_enabled         # default set to false\r\n    type            = \"lb_cookie\"                                      # default = lb_cookie. Only possible value for applicatoin load balancer\r\n    cookie_duration = var.http_target_group_stickiness_cookie_duration # default 8640 seconds (1 day).\r\n  }\r\n  #tags = https://github.com/hashicorp/terraform/issues/15226\r\n\r\n  lifecycle {\r\n    create_before_destroy = true\r\n  }\r\n}\r\n\r\nresource \"aws_lb_target_group\" \"tg_https\" {\r\n  # Check the number of https target group names matches the number of https target group ports.\r\n  # If check is ok creates the number of https target group resources based on the number of https target group names\r\n  count = var.lb_https_listener == true ? var.lb_https_offloading == false ? length(var.https_target_group_names) == length(var.https_target_group_ports) ? length(var.https_target_group_names) : 0 : 0 : 0\r\n\r\n  ### Required Arguments ###\r\n  name     = \"${var.prefix}${element(var.https_target_group_names, count.index)}${var.suffix}\" # default prefix/suffix = \"\". Default target group name = [\"https-target-group\"] N.B. 32 Character limit with prefix/suffix\r\n  port     = element(var.https_target_group_ports, count.index)                                # default = [443]\r\n  protocol = \"HTTPS\"\r\n  vpc_id   = var.vpc_id\r\n\r\n  health_check {\r\n    interval            = var.https_health_check_interval #default = 30\r\n    path                = var.https_health_check_path     #default = \"/\"\r\n    port                = var.https_health_check_port     #default = \"traffic-port\"\r\n    protocol            = \"HTTPS\"\r\n    timeout             = var.https_health_check_timeout             #default = 5\r\n    healthy_threshold   = var.https_health_check_healthy_threshold   #default = 3\r\n    unhealthy_threshold = var.https_health_check_unhealthy_threshold #default = 3\r\n    matcher             = var.https_health_check_matcher             #default = 200\r\n  }\r\n\r\n  target_type = \"instance\"\r\n\r\n  ### Optional Arguments ###\r\n  deregistration_delay = var.https_target_group_deregistration_delay # default = 300.\r\n\r\n  stickiness {\r\n    enabled         = var.https_target_group_stickiness_enabled         # default set to false\r\n    type            = \"lb_cookie\"                                       # default = lb_cookie. Only possible value for applicatoin load balancer\r\n    cookie_duration = var.https_target_group_stickiness_cookie_duration # default 8640 seconds (1 day).\r\n  }\r\n\r\n  lifecycle {\r\n    create_before_destroy = true\r\n  }\r\n}\r\n\r\nlocals {\r\nlb_security_groups = (var.lb_http_listener == true ? var.lb_https_listener == true ? concat(var.http_security_group_ids, var.https_security_group_ids) : var.http_security_group_ids : var.https_security_group_ids)\r\n\r\n  lb_subnet_ids =     (var.lb_internal == true ? var.lb_private_subnet_ids : var.lb_public_subnet_ids)\r\n}\r\n\r\n### Variables ### \r\n\r\ndata \"aws_caller_identity\" \"current\" {\r\n}\r\n\r\n# Account\r\nprovider \"aws\" {\r\n  region = var.aws_region\r\n}\r\n\r\n# Region\r\nvariable \"aws_region\" {\r\n  description = \"The AWS region to run in.\"\r\n  default     = \"eu-central-1\"\r\n}\r\n\r\n# VPC ID\r\nvariable \"vpc_id\" {\r\n  description = \"The VPC ID in which the resources should be created.\"\r\n}\r\n\r\n# Prefix\r\nvariable \"prefix\" {\r\n  description = \"A prefix which is added to each resource name.\"\r\n  default     = \"\"\r\n}\r\n\r\n# Suffix\r\nvariable \"suffix\" {\r\n  description = \"A suffix which is added to each resource name.\"\r\n  default     = \"\"\r\n}\r\n# HTTP target group names\r\nvariable \"http_target_group_names\" {\r\n  type        = list(string)\r\n  description = \"Name(s) of the http target group(s)\"\r\n  default     = [\"http-target-group\"] #N.B. Target Group name acceptable characters: letters, digits or the dash\r\n}\r\n\r\n# HTTP target group ports\r\nvariable \"http_target_group_ports\" {\r\n  type        = list(string)\r\n  description = \"Port(s) of the http target group(s)\"\r\n  default     = [80]\r\n}\r\n\r\n# HTTP target group degregistration delay\r\nvariable \"http_target_group_deregistration_delay\" {\r\n  description = \"Deregistration delay for the http target group(s)\"\r\n  default     = 300 #Possible values in seconds: 0-3600\r\n}\r\n\r\n##HTTP target group health checks\r\n# HTTP target group health check intveral\r\nvariable \"http_health_check_interval\" {\r\n  description = \"Set HTTP health check interval\"\r\n  default     = 30 #min=5 max=300\r\n}\r\n\r\n# HTTP target group health check path\r\nvariable \"http_health_check_path\" {\r\n  description = \"Set HTTP health check path\"\r\n  default     = \"/\"\r\n}\r\n\r\n# HTTP target group health check port\r\nvariable \"http_health_check_port\" {\r\n  description = \"Set HTTP health check port\"\r\n  default     = \"traffic-port\"\r\n}\r\n\r\n# HTTP target group health check protocol\r\nvariable \"http_health_check_protocol\" {\r\n  description = \"Set HTTP health check protocol\"\r\n  default     = \"HTTP\"\r\n}\r\n\r\n# HTTP target group health check timeout\r\nvariable \"http_health_check_timeout\" {\r\n  description = \"Set HTTP health check timeout\"\r\n  default     = 5 #min=2 max=60\r\n}\r\n\r\n# HTTP target group health check healthy threshold\r\nvariable \"http_health_check_healthy_threshold\" {\r\n  description = \"Set HTTP health check healthy threshold\"\r\n  default     = 3\r\n}\r\n\r\n# HTTP target group health cehck unhealthy threshold\r\nvariable \"http_health_check_unhealthy_threshold\" {\r\n  description = \"Set HTTP health check unhealthy threshold\"\r\n  default     = 3\r\n}\r\n\r\n# HTTP target group health check  matcher\r\nvariable \"http_health_check_matcher\" {\r\n  description = \"Set HTTP health check matcher\"\r\n  default     = 200 #Matcher aka success code. Range-example: 200-299\r\n}\r\n\r\n## HTTP target group sticky cookie settings\r\n# HTTP target group stickiness enabled/disabled\r\nvariable \"http_target_group_stickiness_enabled\" {\r\n  description = \"Turn stickiness on/off for the http target group(s)\"\r\n  default     = false\r\n}\r\n\r\n# HTTP cookie duration for stickiness if enabled\r\nvariable \"http_target_group_stickiness_cookie_duration\" {\r\n  description = \"Cookie Duration for stickiness of the http target group(s)\"\r\n  default     = 8640 #Possible values 1-604800 (604800 = 1 day).\r\n}\r\n### HTTPS target group variables ###\r\n# HTTPS target group names\r\nvariable \"https_target_group_names\" {\r\n  type        = list(string)\r\n  description = \"Name(s) of the https target group(s)\"\r\n  default     = [\"https-target-group\"] #N.B. Target Group name acceptable characters: letters, digits or the dash\r\n}\r\n\r\n# HTTPS target group ports\r\nvariable \"https_target_group_ports\" {\r\n  type        = list(string)\r\n  description = \"Port(s) of the https target group(s)\"\r\n  default     = [443]\r\n}\r\n\r\n# HTTPS target group degregistration delay\r\nvariable \"https_target_group_deregistration_delay\" {\r\n  description = \"Deregistration delay for the https target group(s)\"\r\n  default     = 300 #Possible values in seconds: 0-3600\r\n}\r\n\r\n##HTTPS target group health checks\r\n# HTTPS target group health check intveral\r\nvariable \"https_health_check_interval\" {\r\n  description = \"Set HTTPS health check interval\"\r\n  default     = 30 #min=5 max=300\r\n}\r\n\r\n# HTTPS target group health check path\r\nvariable \"https_health_check_path\" {\r\n  description = \"Set HTTPS health check path\"\r\n  default     = \"/\"\r\n}\r\n\r\n# HTTPS target group health check port\r\nvariable \"https_health_check_port\" {\r\n  description = \"Set HTTPS health check port\"\r\n  default     = \"traffic-port\"\r\n}\r\n\r\n# HTTPS target group health check protocol\r\nvariable \"https_health_check_protocol\" {\r\n  description = \"Set HTTPS health check protocol\"\r\n  default     = \"HTTPS\"\r\n}\r\n\r\n# HTTPS target group health check timeout\r\nvariable \"https_health_check_timeout\" {\r\n  description = \"Set HTTPS health check timeout\"\r\n  default     = 5 #min=2 max=60\r\n}\r\n\r\n# HTTPS target group health check healthy threshold\r\nvariable \"https_health_check_healthy_threshold\" {\r\n  description = \"Set HTTPS health check healthy threshold\"\r\n  default     = 3\r\n}\r\n\r\n# HTTPS target group health cehck unhealthy threshold\r\nvariable \"https_health_check_unhealthy_threshold\" {\r\n  description = \"Set HTTPS health check unhealthy threshold\"\r\n  default     = 3\r\n}\r\n\r\n# HTTPS target group health check  matcher\r\nvariable \"https_health_check_matcher\" {\r\n  description = \"Set HTTPS health check matcher\"\r\n  default     = 200 #Matcher aka success code. Range-example: 200-299\r\n}\r\n\r\n## HTTPS target group sticky cookie settings\r\n# HTTPS target group stickiness enabled/disabled\r\nvariable \"https_target_group_stickiness_enabled\" {\r\n  description = \"Turn stickiness on/off for the https target group(s)\"\r\n  default     = false\r\n}\r\n\r\n# HTTPS cookie duration for stickiness if enabled\r\nvariable \"https_target_group_stickiness_cookie_duration\" {\r\n  description = \"Cookie Duration for stickiness of the https target group(s)\"\r\n  default     = 8640 #Possible values 1-604800 (604800 = 1 day).\r\n}\r\n\r\n# Load balancer idle timeout\r\nvariable \"lb_idle_timeout\" {\r\n  description = \"Idle timeout for the loadbalancer.\"\r\n  default     = 60 #seconds\r\n}\r\n\r\n# Load balancer enable http2\r\nvariable \"lb_enable_http2\" {\r\n  description = \"Define is http2 is enabled\"\r\n  default     = true\r\n}\r\n\r\n# Load balancer deletion protection\r\nvariable \"lb_enable_deletion_protection\" {\r\n  description = \"Enable deletion protection\"\r\n  default     = false\r\n}\r\n\r\n### internal / external\r\n# Load balancer name\r\nvariable \"lb_name\" {\r\n  description = \"Name of the loadbalancer\"\r\n  default     = \"loadbalancer\"\r\n}\r\n\r\n# Load balancer internal or external\r\nvariable \"lb_internal\" {\r\n  description = \"Define if the loadbalancer should be internal or not\"\r\n  default     = true\r\n}\r\n\r\n## Load balancer listener variables\r\n# Load balancer HTTP listener needed?\r\nvariable \"lb_http_listener\" {\r\n  description = \"If true add a HTTP listener\"\r\n  default     = false\r\n}\r\n\r\n# Load balancer HTTPS listener needed?\r\nvariable \"lb_https_listener\" {\r\n  description = \"If true add a HTTPS listener\"\r\n  default     = false\r\n}\r\n\r\n# Load balancer HTTPS offloading?\r\nvariable \"lb_https_offloading\" {\r\n  description = \"If true offload to HTTP\"\r\n  default     = true\r\n}\r\n\r\n# Load balancer HTTP listener port\r\nvariable \"lb_http_listener_port\" {\r\n  description = \"HTTP listener port of the loadbalancer\"\r\n  default     = 80\r\n}\r\n\r\n# Loadbalancer HTTPS listener port\r\nvariable \"lb_https_listener_port\" {\r\n  description = \"HTTPS listener port of the loadbalancer\"\r\n  default     = 443\r\n}\r\n\r\n## host headers\r\n# host headers for load balancer listener rules\r\nvariable \"host_headers\" {\r\n  type        = list(string)\r\n  description = \"Host headers for load balancer listener rules\"\r\n  #default     = []\r\n}\r\n\r\n# Certificate ARN for the HTTPS listener\r\nvariable \"certificate_arn\" {\r\n  description = \"Certificate ARN for the HTTPS listener\"\r\n  default     = null\r\n}\r\n\r\n\r\n## subnet groups\r\n# Load balancer public subnet groups\r\nvariable \"lb_public_subnet_ids\" {\r\n  type        = list(string)\r\n  description = \"The Public Subnet ID(s) which should be attached to the loadbalancer\"\r\n  default     = null\r\n}\r\n\r\n# Load balancer private subnet groups\r\nvariable \"lb_private_subnet_ids\" {\r\n  type        = list(string)\r\n  description = \"The Private Subnet ID(s) which should be attached to the loadbalancer\"\r\n  default     = null\r\n}\r\n\r\n## Load balancer security groups\r\n# Load balancer additional security groups\r\n\r\nvariable \"http_security_group_ids\" {\r\n  type        = list(string)\r\n  description = \"The HTTP security groups for the load balancer\"\r\n  default     = [null]\r\n}\r\n\r\nvariable \"https_security_group_ids\" {\r\n  type        = list(string)\r\n  description = \"The HTTPS security groups for the load balancer\"\r\n  default     = [null]\r\n}\r\n\r\nvariable \"target_ids\" {\r\n  description = \"Instance IDs for the target group(s)\"\r\n  default     = \"\"\r\n}\r\n\r\n\r\n```\r\n\r\n### Debug Output\r\n<!--\r\nFull debug output can be obtained by running Terraform with the environment variable `TF_LOG=trace`. Please create a GitHub Gist containing the debug output. Please do _not_ paste the debug output in the issue, since debug output is long.\r\n\r\nDebug output may contain sensitive information. Please review it before posting publicly, and if you are concerned feel free to encrypt the files using the HashiCorp security public key.\r\n-->\r\n\r\n### Crash Output\r\n<!--\r\nIf the console output indicates that Terraform crashed, please share a link to a GitHub Gist containing the output of the `crash.log` file.\r\n-->\r\n\r\n### Expected Behavior\r\n<!--\r\nWhat should have happened?\r\n-->\r\n\r\n### Actual Behavior\r\n<!--\r\nWhat actually happened?\r\n-->\r\n\r\n### Steps to Reproduce\r\n<!--\r\nPlease list the full steps required to reproduce the issue, for example:\r\n1. `terraform init`\r\n2. `terraform apply`\r\n-->\r\n\r\n### Additional Context\r\n<!--\r\nAre there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior?\r\n-->\r\n\r\n### References\r\n<!--\r\nAre there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:\r\n\r\n- #6017\r\n\r\n-->\r\n"}}
{"actor":{"display_login":"Geartrixy"}}