{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5985","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5985/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5985/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5985/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/5985","id":363661581,"node_id":"MDU6SXNzdWUzNjM2NjE1ODE=","number":5985,"title":"Terraform crash - AWS","user":{"login":"hashibot[bot]","id":35615658,"node_id":"MDM6Qm90MzU2MTU2NTg=","avatar_url":"https://avatars2.githubusercontent.com/in/8332?v=4","gravatar_id":"","url":"https://api.github.com/users/hashibot%5Bbot%5D","html_url":"https://github.com/apps/hashibot","followers_url":"https://api.github.com/users/hashibot%5Bbot%5D/followers","following_url":"https://api.github.com/users/hashibot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/hashibot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/hashibot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/hashibot%5Bbot%5D/repos","events_url":"https://api.github.com/users/hashibot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot%5Bbot%5D/received_events","type":"Bot","site_admin":false},"labels":[{"id":620316239,"node_id":"MDU6TGFiZWw2MjAzMTYyMzk=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":620316275,"node_id":"MDU6TGFiZWw2MjAzMTYyNzU=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/crash","name":"crash","color":"e11d21","default":false},{"id":794043766,"node_id":"MDU6TGFiZWw3OTQwNDM3NjY=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/ec2","name":"service/ec2","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/milestones/42","html_url":"https://github.com/terraform-providers/terraform-provider-aws/milestone/42","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/milestones/42/labels","id":3672538,"node_id":"MDk6TWlsZXN0b25lMzY3MjUzOA==","number":42,"title":"v1.38.0","description":"","creator":{"login":"bflad","id":189114,"node_id":"MDQ6VXNlcjE4OTExNA==","avatar_url":"https://avatars3.githubusercontent.com/u/189114?v=4","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":26,"state":"open","created_at":"2018-09-19T19:57:38Z","updated_at":"2018-09-25T19:14:45Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-09-25T16:20:03Z","updated_at":"2018-09-25T19:14:45Z","closed_at":"2018-09-25T19:14:45Z","author_association":"NONE","body":"_This issue was originally opened by @thiagoalves as hashicorp/terraform#18936. It was migrated here as a result of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._\r\n\r\n<hr>\r\n\r\n<!--\r\nHi there,\r\n\r\nThank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.\r\n\r\nIf your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers .\r\n-->\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\nTerraform v0.11.8\r\n+ provider.aws v1.37.0\r\n```\r\n\r\n### Terraform Configuration Files\r\n<!--\r\nPaste the relevant parts of your Terraform configuration between the ``` marks below.\r\n\r\nFor large Terraform configs, please use a service like Dropbox and share a link to the ZIP file. For security, you can also encrypt the files using our GPG public key.\r\n-->\r\n\r\n```hcl\r\nprovider \"aws\" {\r\n  region = \"us-west-1\"\r\n}\r\n\r\ndata \"aws_vpc\" \"default\" {\r\n  default = true\r\n}\r\n\r\ndata \"aws_subnet_ids\" \"all\" {\r\n  vpc_id = \"${data.aws_vpc.default.id}\"\r\n}\r\n\r\ndata \"aws_security_group\" \"default\" {\r\n  vpc_id = \"${data.aws_vpc.default.id}\"\r\n  name   = \"default\"\r\n}\r\n\r\ndata \"aws_ami\" \"ubuntu\" {\r\n  most_recent = true\r\n  filter {\r\n    name      = \"name\"\r\n    values    = [\"gitops*\"]\r\n  }\r\n  owners      = [\"583161073698\"]\r\n}\r\n\r\nresource \"aws_placement_group\" \"gitops-pg\" {\r\n  name     = \"gitops-pg\"\r\n  strategy = \"cluster\"\r\n}\r\n\r\nresource \"aws_key_pair\" \"gitops-key\" {\r\n  key_name   = \"gitops-key\"\r\n  public_key = \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDC94OedAUtf5sh+zbX6icJrmR0tGCSI9oJCU4FdMMkXaFPemXdxpyB6qkJnx1sP5inGWBnmy2KdiqtGSQoHN0VW7TvYJzISv9xeMmhDvbWUSF+811Fhdvd7ZzFHClB2vqPjVwyIaTbBCIgus40XPcMnM7TwwSlTsKxKNzottZB+riIsqPGj7FGMcb17TlbWwfyMGyIjSb4f+wwBNF01ydedSJEo11CsZrQ/1B8BNplZrQG5LI7RmsXo6ayXT9Wmia/D0pd3DJT+f5SzsxtLaNC0H046r01IjNUIiockDFULnXLccs9zh4ICP0SnDzxQoTM0nOlolade1Dc9uDMlus1 banjo+thiago.alves@banjo\"\r\n}\r\n\r\nresource \"aws_launch_template\" \"gitops-lt\" {\r\n  name_prefix = \"gitops-instance-\"\r\n  image_id = \"${data.aws_ami.ubuntu.id}\"\r\n  instance_type = \"c5.large\"\r\n\r\n  ebs_optimized = true\r\n\r\n  instance_market_options {\r\n    market_type = \"spot\"\r\n  }\r\n\r\n  key_name = \"${aws_key_pair.gitops-key.id}\"\r\n\r\n  placement {\r\n    availability_zone = \"us-west-1a\"\r\n  }\r\n\r\n  vpc_security_group_ids = [\"sg-606b5507\"]\r\n\r\n  tag_specifications {\r\n    resource_type = \"instance\"\r\n    tags {\r\n      Name = \"gitops-instance-x\"\r\n      Owner = \"talves\"\r\n      Group = \"gitops-asg\"\r\n    }\r\n  }\r\n\r\n  user_data = \"${base64encode(\"touch /tmp/test\")}\"\r\n\r\n  tags {\r\n    Owner = \"talves\"\r\n  }\r\n}\r\n\r\nresource \"aws_autoscaling_group\" \"gitops-asg\" {\r\n  availability_zones = [\"us-west-1a\"]\r\n  desired_capacity = 3\r\n  max_size = 3\r\n  min_size = 3\r\n  placement_group = \"${aws_placement_group.gitops-pg.id}\"\r\n  launch_template = {\r\n    id = \"${aws_launch_template.gitops-lt.id}\"\r\n    version = \"$$Latest\"\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\nhttps://gist.github.com/thiagoalves/696999d503f1d533ef3195c9da40aa70\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\nhttps://gist.github.com/thiagoalves/f31d9bded570c620a06ef69ae45bcfe8\r\n\r\n### Expected Behavior\r\n<!--\r\nWhat should have happened?\r\n-->\r\nTerraform plan should run without errors\r\n\r\n### Actual Behavior\r\n<!--\r\nWhat actually happened?\r\n-->\r\nTerraform plan crashed\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\n1. `terraform init`\r\n2. `terraform plan`\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\nTesting this on an AWS environment.\r\n\r\nIf I use a different value for data aws_ami, it works fine:\r\n\r\n```\r\n data \"aws_ami\" \"ubuntu\" {\r\n   most_recent = true\r\n  name_regex  = \"^ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-\\\\d+\"\r\n  owners      = [\"099720109477\"]\r\n}\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- hashicorp/terraform#6017\r\n\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments/424466663","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/5985#issuecomment-424466663","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/5985","id":424466663,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDQ2NjY2Mw==","user":{"login":"bflad","id":189114,"node_id":"MDQ6VXNlcjE4OTExNA==","avatar_url":"https://avatars3.githubusercontent.com/u/189114?v=4","gravatar_id":"","url":"https://api.github.com/users/bflad","html_url":"https://github.com/bflad","followers_url":"https://api.github.com/users/bflad/followers","following_url":"https://api.github.com/users/bflad/following{/other_user}","gists_url":"https://api.github.com/users/bflad/gists{/gist_id}","starred_url":"https://api.github.com/users/bflad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bflad/subscriptions","organizations_url":"https://api.github.com/users/bflad/orgs","repos_url":"https://api.github.com/users/bflad/repos","events_url":"https://api.github.com/users/bflad/events{/privacy}","received_events_url":"https://api.github.com/users/bflad/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T19:14:45Z","updated_at":"2018-09-25T19:14:45Z","author_association":"CONTRIBUTOR","body":"Hi @thiagoalves 👋  Sorry you're running into this. It turns out this crash is similar to #5963, where this is occurring due to `failed` state AMIs. Not sure if the timing is coincidental or if this is due to a recent change in EC2 API behavior. The fix #5968 has already been merged into master and will release with version 1.38.0 of the AWS provider, likely tomorrow. 👍 "}}
{"actor":{"display_login":"bflad"}}