{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6762","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6762/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6762/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6762/events","html_url":"https://github.com/hashicorp/terraform/issues/6762","id":155680251,"number":6762,"title":"Changes to aws_instance \"root_block_device\" do not trigger resource update/recreation","user":{"login":"modax","id":1032370,"avatar_url":"https://avatars.githubusercontent.com/u/1032370?v=3","gravatar_id":"","url":"https://api.github.com/users/modax","html_url":"https://github.com/modax","followers_url":"https://api.github.com/users/modax/followers","following_url":"https://api.github.com/users/modax/following{/other_user}","gists_url":"https://api.github.com/users/modax/gists{/gist_id}","starred_url":"https://api.github.com/users/modax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modax/subscriptions","organizations_url":"https://api.github.com/users/modax/orgs","repos_url":"https://api.github.com/users/modax/repos","events_url":"https://api.github.com/users/modax/events{/privacy}","received_events_url":"https://api.github.com/users/modax/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":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-05-19T08:28:17Z","updated_at":"2016-10-17T17:29:02Z","closed_at":null,"body":"Hello,\r\n\r\nit appears that changes to the aws_instance#root_block_device fields do not trigger resource updates (i.e. diff is not generated for it).\r\n\r\nBelow you will find a test case which exposes this problem. The schema is based on what's currently in \"root_block_device\" in `builtin/providers/aws/resource_aws_instance.go`.\r\n\r\nRunning it results in:\r\n\r\n```\r\n$  make test TEST=./helper/schema TESTARGS=\"-run TestSchemaMap_Diff\"\r\n==> Checking that code complies with gofmt requirements...\r\n/home/modax/go/bin/stringer\r\ngo generate $(go list ./... | grep -v /vendor/)\r\n2016/05/19 11:25:40 Generated command/internal_plugin_list.go\r\nTF_ACC= go test ./helper/schema -run TestSchemaMap_Diff -timeout=30s -parallel=4\r\n--- FAIL: TestSchemaMap_Diff (0.00s)\r\n        schema_test.go:2505: #\"#61 - computed set with some implicit values\":\r\n\r\n                expected:\r\n                *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{\"root_block_device.0.delete_on_termination\":*terraform.ResourceAttrDiff{Old:\"false\", New:\"true\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, \"root_block_device.0.volume_size\":*terraform.ResourceAttrDiff{Old:\"8\", New:\"50\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}}, Destroy:false, DestroyTainted:false}\r\n\r\n                got:\r\n                <nil>\r\nFAIL\r\nFAIL    github.com/hashicorp/terraform/helper/schema    0.005s\r\nMakefile:37: recipe for target 'test' failed\r\nmake: *** [test] Error 1\r\n```\r\n\r\n```diff\r\n--- a/helper/schema/schema_test.go\r\n+++ b/helper/schema/schema_test.go\r\n@@ -2351,6 +2351,87 @@ func TestSchemaMap_Diff(t *testing.T) {\r\n                        Err: false,\r\n                },\r\n \r\n+               \"#61 - computed set with some implicit values\": {\r\n+                       Schema: map[string]*Schema{\r\n+                               \"root_block_device\": &Schema{\r\n+                                       Type:     TypeSet,\r\n+                                       Optional: true,\r\n+                                       Computed: true,\r\n+                                       Elem: &Resource{\r\n+                                               Schema: map[string]*Schema{\r\n+                                                       \"delete_on_termination\": &Schema{\r\n+                                                               Type:     TypeBool,\r\n+                                                               Optional: true,\r\n+                                                               Default:  true,\r\n+                                                               ForceNew: true,\r\n+                                                       },\r\n+\r\n+                                                       \"iops\": &Schema{\r\n+                                                               Type:     TypeInt,\r\n+                                                               Optional: true,\r\n+                                                               Computed: true,\r\n+                                                               ForceNew: true,\r\n+                                                       },\r\n+\r\n+                                                       \"volume_size\": &Schema{\r\n+                                                               Type:     TypeInt,\r\n+                                                               Optional: true,\r\n+                                                               Computed: true,\r\n+                                                               ForceNew: true,\r\n+                                                       },\r\n+\r\n+                                                       \"volume_type\": &Schema{\r\n+                                                               Type:     TypeString,\r\n+                                                               Optional: true,\r\n+                                                               Computed: true,\r\n+                                                               ForceNew: true,\r\n+                                                       },\r\n+                                               },\r\n+                                       },\r\n+                                       Set: func(v interface{}) int {\r\n+                                               return 0\r\n+                                       },\r\n+                               },\r\n+                       },\r\n+\r\n+                       State: &terraform.InstanceState{\r\n+                               Attributes: map[string]string{\r\n+                                       \"root_block_device.#\":                       \"1\",\r\n+                                       \"root_block_device.0.delete_on_termination\": \"false\",\r\n+                                       \"root_block_device.0.iops\":                  \"24\",\r\n+                                       \"root_block_device.0.volume_size\":           \"8\",\r\n+                                       \"root_block_device.0.volume_type\":           \"gp2\",\r\n+                               },\r\n+                       },\r\n+\r\n+                       Config: map[string]interface{}{\r\n+                               \"root_block_device\": []map[string]interface{}{\r\n+                                       map[string]interface{}{\r\n+                                               \"delete_on_termination\": \"true\",\r\n+                                               \"volume_size\":           50,\r\n+                                               \"volume_type\":           \"gp2\",\r\n+                                       },\r\n+                               },\r\n+                       },\r\n+\r\n+                       Diff: &terraform.InstanceDiff{\r\n+                               Attributes: map[string]*terraform.ResourceAttrDiff{\r\n+                                       \"root_block_device.0.delete_on_termination\": &terraform.ResourceAttrDiff{\r\n+                                               Old:         \"false\",\r\n+                                               New:         \"true\",\r\n+                                               RequiresNew: true,\r\n+                                       },\r\n+                                       \"root_block_device.0.volume_size\": &terraform.ResourceAttrDiff{\r\n+                                               Old:         \"8\",\r\n+                                               New:         \"50\",\r\n+                                               RequiresNew: true,\r\n+                                       },\r\n+                               },\r\n+                       },\r\n+\r\n+                       Err: false,\r\n+               },\r\n+\r\n                \"Bools can be set with 0/1 in config, still get true/false\": {\r\n                        Schema: map[string]*Schema{\r\n                                \"one\": &Schema{\r\n```\r\n\r\nTerraform version 0.6.16 / current master"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/254275585","html_url":"https://github.com/hashicorp/terraform/issues/6762#issuecomment-254275585","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6762","id":254275585,"user":{"login":"imacube","id":7749091,"avatar_url":"https://avatars.githubusercontent.com/u/7749091?v=3","gravatar_id":"","url":"https://api.github.com/users/imacube","html_url":"https://github.com/imacube","followers_url":"https://api.github.com/users/imacube/followers","following_url":"https://api.github.com/users/imacube/following{/other_user}","gists_url":"https://api.github.com/users/imacube/gists{/gist_id}","starred_url":"https://api.github.com/users/imacube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imacube/subscriptions","organizations_url":"https://api.github.com/users/imacube/orgs","repos_url":"https://api.github.com/users/imacube/repos","events_url":"https://api.github.com/users/imacube/events{/privacy}","received_events_url":"https://api.github.com/users/imacube/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T17:29:02Z","updated_at":"2016-10-17T17:29:02Z","body":"Using 0.7.4 I too encountered this with a `aws_launch_configuration` where I changed the `volume_size` of the `root_block_device`. Tainting the `aws_launch_configuration` caused it to be recreated with the correct `volume_size`."}}
{"actor":{"display_login":"imacube"}}