{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/913","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/913/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/913/events","html_url":"https://github.com/hashicorp/terraform/issues/913","id":56320098,"number":913,"title":"aws_instance block_device declaration causes continual resource re-creation","user":{"login":"patricklucas","id":95053,"avatar_url":"https://avatars.githubusercontent.com/u/95053?v=3","gravatar_id":"","url":"https://api.github.com/users/patricklucas","html_url":"https://github.com/patricklucas","followers_url":"https://api.github.com/users/patricklucas/followers","following_url":"https://api.github.com/users/patricklucas/following{/other_user}","gists_url":"https://api.github.com/users/patricklucas/gists{/gist_id}","starred_url":"https://api.github.com/users/patricklucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricklucas/subscriptions","organizations_url":"https://api.github.com/users/patricklucas/orgs","repos_url":"https://api.github.com/users/patricklucas/repos","events_url":"https://api.github.com/users/patricklucas/events{/privacy}","received_events_url":"https://api.github.com/users/patricklucas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"}],"state":"open","locked":false,"assignee":{"login":"phinze","id":37534,"avatar_url":"https://avatars.githubusercontent.com/u/37534?v=3","gravatar_id":"","url":"https://api.github.com/users/phinze","html_url":"https://github.com/phinze","followers_url":"https://api.github.com/users/phinze/followers","following_url":"https://api.github.com/users/phinze/following{/other_user}","gists_url":"https://api.github.com/users/phinze/gists{/gist_id}","starred_url":"https://api.github.com/users/phinze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phinze/subscriptions","organizations_url":"https://api.github.com/users/phinze/orgs","repos_url":"https://api.github.com/users/phinze/repos","events_url":"https://api.github.com/users/phinze/events{/privacy}","received_events_url":"https://api.github.com/users/phinze/received_events","type":"User","site_admin":false},"milestone":null,"comments":21,"created_at":"2015-02-03T01:21:38Z","updated_at":"2015-02-18T01:07:54Z","closed_at":null,"body":"I am unable to use latest (c18b01fa) Terraform to manage AWS instances because it tries to destroy and re-create them on every invocation. I think it has something to with my block device specifications. I have already launched quite a few instances with Terraform, but I can't make any modifications lest they get destroyed.\r\n\r\nHere is the Terraform config and output:\r\n\r\n```\r\n$ cat asdf.tf\r\nprovider \"aws\" {\r\n    region = \"us-west-1\"\r\n}\r\n\r\nresource \"aws_instance\" \"foo-1\" {\r\n    ami = \"ami-abcd1234\"\r\n    instance_type = \"m3.large\"\r\n    subnet_id = \"subnet-ab1234cd\"\r\n    security_groups = [\"sg-01234567\"]\r\n    tags {\r\n        Name = \"test-foo-1\"\r\n        mytag = \"foo\"\r\n    }\r\n    block_device {\r\n        device_name = \"/dev/sda1\"\r\n        volume_type = \"gp2\"\r\n        volume_size = 16\r\n    }\r\n    block_device {\r\n        device_name = \"/dev/sdf\"\r\n        volume_type = \"gp2\"\r\n        volume_size = 1024\r\n    }\r\n}\r\n\r\n$ terraform plan\r\nRefreshing Terraform state prior to plan...\r\n\r\n\r\nThe Terraform execution plan has been generated and is shown below.\r\nResources are shown in alphabetical order for quick scanning. Green resources\r\nwill be created (or destroyed and then created if an existing resource\r\nexists), yellow resources are being changed in-place, and red resources\r\nwill be destroyed.\r\n\r\nNote: You didn't specify an \"-out\" parameter to save this plan, so when\r\n\"apply\" is called, Terraform can't guarantee this is what will execute.\r\n\r\n+ aws_instance.foo-1\r\n    ami:                                           \"\" => \"ami-abcd1234\"\r\n    availability_zone:                             \"\" => \"<computed>\"\r\n    block_device.#:                                \"\" => \"2\"\r\n    block_device.2382792209.delete_on_termination: \"\" => \"1\"\r\n    block_device.2382792209.device_name:           \"\" => \"/dev/sdf\"\r\n    block_device.2382792209.encrypted:             \"\" => \"<computed>\"\r\n    block_device.2382792209.snapshot_id:           \"\" => \"<computed>\"\r\n    block_device.2382792209.virtual_name:          \"\" => \"\"\r\n    block_device.2382792209.volume_size:           \"\" => \"1024\"\r\n    block_device.2382792209.volume_type:           \"\" => \"gp2\"\r\n    block_device.2936417914.delete_on_termination: \"\" => \"1\"\r\n    block_device.2936417914.device_name:           \"\" => \"/dev/sda1\"\r\n    block_device.2936417914.encrypted:             \"\" => \"<computed>\"\r\n    block_device.2936417914.snapshot_id:           \"\" => \"<computed>\"\r\n    block_device.2936417914.virtual_name:          \"\" => \"\"\r\n    block_device.2936417914.volume_size:           \"\" => \"16\"\r\n    block_device.2936417914.volume_type:           \"\" => \"gp2\"\r\n    instance_type:                                 \"\" => \"m3.large\"\r\n    key_name:                                      \"\" => \"<computed>\"\r\n    private_dns:                                   \"\" => \"<computed>\"\r\n    private_ip:                                    \"\" => \"<computed>\"\r\n    public_dns:                                    \"\" => \"<computed>\"\r\n    public_ip:                                     \"\" => \"<computed>\"\r\n    security_groups.#:                             \"\" => \"1\"\r\n    security_groups.2681880818:                    \"\" => \"sg-01234567\"\r\n    subnet_id:                                     \"\" => \"subnet-ab1234cd\"\r\n    tags.#:                                        \"\" => \"2\"\r\n    tags.Name:                                     \"\" => \"test-foo-1\"\r\n    tags.mytag:                                    \"\" => \"foo\"\r\n    tenancy:                                       \"\" => \"<computed>\"\r\n\r\n\r\n\r\n$ terraform apply\r\naws_instance.foo-1: Creating...\r\n  ami:                                           \"\" => \"ami-abcd1234\"\r\n  availability_zone:                             \"\" => \"<computed>\"\r\n  block_device.#:                                \"\" => \"2\"\r\n  block_device.2382792209.delete_on_termination: \"\" => \"1\"\r\n  block_device.2382792209.device_name:           \"\" => \"/dev/sdf\"\r\n  block_device.2382792209.encrypted:             \"\" => \"<computed>\"\r\n  block_device.2382792209.snapshot_id:           \"\" => \"<computed>\"\r\n  block_device.2382792209.virtual_name:          \"\" => \"\"\r\n  block_device.2382792209.volume_size:           \"\" => \"1024\"\r\n  block_device.2382792209.volume_type:           \"\" => \"gp2\"\r\n  block_device.2936417914.delete_on_termination: \"\" => \"1\"\r\n  block_device.2936417914.device_name:           \"\" => \"/dev/sda1\"\r\n  block_device.2936417914.encrypted:             \"\" => \"<computed>\"\r\n  block_device.2936417914.snapshot_id:           \"\" => \"<computed>\"\r\n  block_device.2936417914.virtual_name:          \"\" => \"\"\r\n  block_device.2936417914.volume_size:           \"\" => \"16\"\r\n  block_device.2936417914.volume_type:           \"\" => \"gp2\"\r\n  instance_type:                                 \"\" => \"m3.large\"\r\n  key_name:                                      \"\" => \"<computed>\"\r\n  private_dns:                                   \"\" => \"<computed>\"\r\n  private_ip:                                    \"\" => \"<computed>\"\r\n  public_dns:                                    \"\" => \"<computed>\"\r\n  public_ip:                                     \"\" => \"<computed>\"\r\n  security_groups.#:                             \"\" => \"1\"\r\n  security_groups.2681880818:                    \"\" => \"sg-01234567\"\r\n  subnet_id:                                     \"\" => \"subnet-ab1234cd\"\r\n  tags.#:                                        \"\" => \"2\"\r\n  tags.Name:                                     \"\" => \"test-foo-1\"\r\n  tags.mytag:                                    \"\" => \"foo\"\r\n  tenancy:                                       \"\" => \"<computed>\"\r\naws_instance.foo-1: Creation complete\r\n\r\nApply complete! Resources: 1 added, 0 changed, 0 destroyed.\r\n\r\nThe state of your infrastructure has been saved to the path\r\nbelow. This state is required to modify and destroy your\r\ninfrastructure, so keep it safe. To inspect the complete state\r\nuse the `terraform show` command.\r\n\r\nState path: terraform.tfstate\r\n\r\n$ terraform plan\r\nRefreshing Terraform state prior to plan...\r\n\r\naws_instance.foo-1: Refreshing state... (ID: i-5381849b)\r\n\r\nThe Terraform execution plan has been generated and is shown below.\r\nResources are shown in alphabetical order for quick scanning. Green resources\r\nwill be created (or destroyed and then created if an existing resource\r\nexists), yellow resources are being changed in-place, and red resources\r\nwill be destroyed.\r\n\r\nNote: You didn't specify an \"-out\" parameter to save this plan, so when\r\n\"apply\" is called, Terraform can't guarantee this is what will execute.\r\n\r\n-/+ aws_instance.foo-1\r\n    ami:                                           \"ami-abcd1234\" => \"ami-abcd1234\"\r\n    availability_zone:                             \"us-west-1a\" => \"<computed>\"\r\n    block_device.#:                                \"1\" => \"2\"\r\n    block_device.2382792209.delete_on_termination: \"true\" => \"1\" (forces new resource)\r\n    block_device.2382792209.device_name:           \"/dev/sdf\" => \"/dev/sdf\" (forces new resource)\r\n    block_device.2382792209.encrypted:             \"false\" => \"<computed>\"\r\n    block_device.2382792209.snapshot_id:           \"\" => \"<computed>\"\r\n    block_device.2382792209.virtual_name:          \"\" => \"\"\r\n    block_device.2382792209.volume_size:           \"1024\" => \"1024\" (forces new resource)\r\n    block_device.2382792209.volume_type:           \"gp2\" => \"gp2\" (forces new resource)\r\n    block_device.2936417914.delete_on_termination: \"\" => \"1\" (forces new resource)\r\n    block_device.2936417914.device_name:           \"\" => \"/dev/sda1\" (forces new resource)\r\n    block_device.2936417914.encrypted:             \"\" => \"<computed>\" (forces new resource)\r\n    block_device.2936417914.snapshot_id:           \"\" => \"<computed>\" (forces new resource)\r\n    block_device.2936417914.virtual_name:          \"\" => \"\" (forces new resource)\r\n    block_device.2936417914.volume_size:           \"\" => \"16\" (forces new resource)\r\n    block_device.2936417914.volume_type:           \"\" => \"gp2\" (forces new resource)\r\n    instance_type:                                 \"m3.large\" => \"m3.large\"\r\n    key_name:                                      \"\" => \"<computed>\"\r\n    private_dns:                                   \"ip-10-40-11-63.example.com\" => \"<computed>\"\r\n    private_ip:                                    \"10.40.11.63\" => \"<computed>\"\r\n    public_dns:                                    \"\" => \"<computed>\"\r\n    public_ip:                                     \"\" => \"<computed>\"\r\n    security_groups.#:                             \"1\" => \"1\"\r\n    security_groups.2681880818:                    \"sg-01234567\" => \"sg-01234567\"\r\n    subnet_id:                                     \"subnet-ab1234cd\" => \"subnet-ab1234cd\"\r\n    tags.#:                                        \"2\" => \"2\"\r\n    tags.Name:                                     \"test-foo-1\" => \"test-foo-1\"\r\n    tags.mytag:                                    \"foo\" => \"foo\"\r\n    tenancy:                                       \"default\" => \"<computed>\"\r\n\r\n\r\n\r\n$ terraform apply\r\naws_instance.foo-1: Refreshing state... (ID: i-5381849b)\r\naws_instance.foo-1: Destroying...\r\naws_instance.foo-1: Destruction complete\r\naws_instance.foo-1: Creating...\r\n  ami:                                           \"\" => \"ami-abcd1234\"\r\n  availability_zone:                             \"\" => \"<computed>\"\r\n  block_device.#:                                \"\" => \"2\"\r\n  block_device.2382792209.delete_on_termination: \"\" => \"1\"\r\n  block_device.2382792209.device_name:           \"\" => \"/dev/sdf\"\r\n  block_device.2382792209.encrypted:             \"\" => \"<computed>\"\r\n  block_device.2382792209.snapshot_id:           \"\" => \"<computed>\"\r\n  block_device.2382792209.virtual_name:          \"\" => \"\"\r\n  block_device.2382792209.volume_size:           \"\" => \"1024\"\r\n  block_device.2382792209.volume_type:           \"\" => \"gp2\"\r\n  block_device.2936417914.delete_on_termination: \"\" => \"1\"\r\n  block_device.2936417914.device_name:           \"\" => \"/dev/sda1\"\r\n  block_device.2936417914.encrypted:             \"\" => \"<computed>\"\r\n  block_device.2936417914.snapshot_id:           \"\" => \"<computed>\"\r\n  block_device.2936417914.virtual_name:          \"\" => \"\"\r\n  block_device.2936417914.volume_size:           \"\" => \"16\"\r\n  block_device.2936417914.volume_type:           \"\" => \"gp2\"\r\n  instance_type:                                 \"\" => \"m3.large\"\r\n  key_name:                                      \"\" => \"<computed>\"\r\n  private_dns:                                   \"\" => \"<computed>\"\r\n  private_ip:                                    \"\" => \"<computed>\"\r\n  public_dns:                                    \"\" => \"<computed>\"\r\n  public_ip:                                     \"\" => \"<computed>\"\r\n  security_groups.#:                             \"\" => \"1\"\r\n  security_groups.2681880818:                    \"\" => \"sg-01234567\"\r\n  subnet_id:                                     \"\" => \"subnet-ab1234cd\"\r\n  tags.#:                                        \"\" => \"2\"\r\n  tags.Name:                                     \"\" => \"test-foo-1\"\r\n  tags.mytag:                                    \"\" => \"foo\"\r\n  tenancy:                                       \"\" => \"<computed>\"\r\naws_instance.foo-1: Creation complete\r\n\r\nApply complete! Resources: 1 added, 0 changed, 1 destroyed.\r\n\r\nThe state of your infrastructure has been saved to the path\r\nbelow. This state is required to modify and destroy your\r\ninfrastructure, so keep it safe. To inspect the complete state\r\nuse the `terraform show` command.\r\n\r\nState path: terraform.tfstate\r\n\r\n$ terraform plan\r\nRefreshing Terraform state prior to plan...\r\n\r\naws_instance.foo-1: Refreshing state... (ID: i-4386838b)\r\n\r\nThe Terraform execution plan has been generated and is shown below.\r\nResources are shown in alphabetical order for quick scanning. Green resources\r\nwill be created (or destroyed and then created if an existing resource\r\nexists), yellow resources are being changed in-place, and red resources\r\nwill be destroyed.\r\n\r\nNote: You didn't specify an \"-out\" parameter to save this plan, so when\r\n\"apply\" is called, Terraform can't guarantee this is what will execute.\r\n\r\n-/+ aws_instance.foo-1\r\n    ami:                                           \"ami-abcd1234\" => \"ami-abcd1234\"\r\n    availability_zone:                             \"us-west-1a\" => \"<computed>\"\r\n    block_device.#:                                \"1\" => \"2\"\r\n    block_device.2382792209.delete_on_termination: \"true\" => \"1\" (forces new resource)\r\n    block_device.2382792209.device_name:           \"/dev/sdf\" => \"/dev/sdf\" (forces new resource)\r\n    block_device.2382792209.encrypted:             \"false\" => \"<computed>\"\r\n    block_device.2382792209.snapshot_id:           \"\" => \"<computed>\"\r\n    block_device.2382792209.virtual_name:          \"\" => \"\"\r\n    block_device.2382792209.volume_size:           \"1024\" => \"1024\" (forces new resource)\r\n    block_device.2382792209.volume_type:           \"gp2\" => \"gp2\" (forces new resource)\r\n    block_device.2936417914.delete_on_termination: \"\" => \"1\" (forces new resource)\r\n    block_device.2936417914.device_name:           \"\" => \"/dev/sda1\" (forces new resource)\r\n    block_device.2936417914.encrypted:             \"\" => \"<computed>\" (forces new resource)\r\n    block_device.2936417914.snapshot_id:           \"\" => \"<computed>\" (forces new resource)\r\n    block_device.2936417914.virtual_name:          \"\" => \"\" (forces new resource)\r\n    block_device.2936417914.volume_size:           \"\" => \"16\" (forces new resource)\r\n    block_device.2936417914.volume_type:           \"\" => \"gp2\" (forces new resource)\r\n    instance_type:                                 \"m3.large\" => \"m3.large\"\r\n    key_name:                                      \"\" => \"<computed>\"\r\n    private_dns:                                   \"ip-10-40-10-56.example.com\" => \"<computed>\"\r\n    private_ip:                                    \"10.40.10.56\" => \"<computed>\"\r\n    public_dns:                                    \"\" => \"<computed>\"\r\n    public_ip:                                     \"\" => \"<computed>\"\r\n    security_groups.#:                             \"1\" => \"1\"\r\n    security_groups.2681880818:                    \"sg-01234567\" => \"sg-01234567\"\r\n    subnet_id:                                     \"subnet-ab1234cd\" => \"subnet-ab1234cd\"\r\n    tags.#:                                        \"2\" => \"2\"\r\n    tags.Name:                                     \"test-foo-1\" => \"test-foo-1\"\r\n    tags.mytag:                                    \"foo\" => \"foo\"\r\n    tenancy:                                       \"default\" => \"<computed>\"\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/74791203","html_url":"https://github.com/hashicorp/terraform/issues/913#issuecomment-74791203","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/913","id":74791203,"user":{"login":"patricklucas","id":95053,"avatar_url":"https://avatars.githubusercontent.com/u/95053?v=3","gravatar_id":"","url":"https://api.github.com/users/patricklucas","html_url":"https://github.com/patricklucas","followers_url":"https://api.github.com/users/patricklucas/followers","following_url":"https://api.github.com/users/patricklucas/following{/other_user}","gists_url":"https://api.github.com/users/patricklucas/gists{/gist_id}","starred_url":"https://api.github.com/users/patricklucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricklucas/subscriptions","organizations_url":"https://api.github.com/users/patricklucas/orgs","repos_url":"https://api.github.com/users/patricklucas/repos","events_url":"https://api.github.com/users/patricklucas/events{/privacy}","received_events_url":"https://api.github.com/users/patricklucas/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T01:07:54Z","updated_at":"2015-02-18T01:07:54Z","body":"@phinze: sgtm\r\n\r\nI concur with @joegoggins can likely be safely defaulted to /dev/sda1, though I believe that volume_size and volume_type should fall back to your account defaults as is the current behavior."}}