{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/393","labels_url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/393/comments","events_url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/393/events","html_url":"https://github.com/mitchellh/vagrant-aws/issues/393","id":89288911,"number":393,"title":"multiple block_device_mapping definitions merge instead of overwriting one another","user":{"login":"iMoses","id":1083065,"avatar_url":"https://avatars.githubusercontent.com/u/1083065?v=3","gravatar_id":"","url":"https://api.github.com/users/iMoses","html_url":"https://github.com/iMoses","followers_url":"https://api.github.com/users/iMoses/followers","following_url":"https://api.github.com/users/iMoses/following{/other_user}","gists_url":"https://api.github.com/users/iMoses/gists{/gist_id}","starred_url":"https://api.github.com/users/iMoses/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iMoses/subscriptions","organizations_url":"https://api.github.com/users/iMoses/orgs","repos_url":"https://api.github.com/users/iMoses/repos","events_url":"https://api.github.com/users/iMoses/events{/privacy}","received_events_url":"https://api.github.com/users/iMoses/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-18T13:06:43Z","updated_at":"2015-10-29T15:38:13Z","closed_at":null,"body":"I have a default configuration for aws providers which looks like this:\r\n\r\n```\r\nconfig.vm.provider \"aws\" do |aws, override|\r\n    aws.instance_type = \"c3.xlarge\"\r\n    aws.block_device_mapping = [{\r\n        'DeviceName' => '/dev/sda1',\r\n        'Ebs.VolumeSize' => 30,\r\n    }]\r\nend\r\n```\r\n\r\nAnd further down the Vagrantfile I have a definition for an instance which looks like this:\r\n\r\n```\r\nconfig.vm.define \"test\" do |node|\r\n    node.vm.provider \"aws\" do |aws, override|\r\n        aws.instance_type = \"c3.2xlarge\"\r\n        aws.tags = {'Name' => 'TEST'}\r\n        aws.block_device_mapping = [{\r\n            'DeviceName' => '/dev/sda1',\r\n            'Ebs.VolumeSize' => 60,\r\n            'Ebs.VolumeType' => 'io1',\r\n            'Ebs.DeleteOnTermination' => 'true',\r\n            'Ebs.Iops' => 600,\r\n        }]\r\n    end\r\nend\r\n```\r\n\r\nI would have expected that `aws.block_device_mapping` would be overwritten by \"test\" the same way `aws.instance_type` does, but instead what happens is that both of them merge and it results in:\r\n\r\n```\r\n==> test:  -- Block Device Mapping: [{\"DeviceName\"=>\"/dev/sda1\", \"Ebs.VolumeSize\"=>60, \"Ebs.VolumeType\"=>\"io1\", \"Ebs.DeleteOnTermination\"=>\"true\", \"Ebs.Iops\"=>600}, {\"DeviceName\"=>\"/dev/sda1\", \"Ebs.VolumeSize\"=>30}]\r\n```\r\n\r\nAnd effectively because both try to set configurations for the same `DeviceName` the later \"wins\" only the default configuration takes effect.\r\n\r\nWhat can I do to fix it? I'm assuming it's a bug."},"comment":{"url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/comments/152218651","html_url":"https://github.com/mitchellh/vagrant-aws/issues/393#issuecomment-152218651","issue_url":"https://api.github.com/repos/mitchellh/vagrant-aws/issues/393","id":152218651,"user":{"login":"jjappi","id":2580412,"avatar_url":"https://avatars.githubusercontent.com/u/2580412?v=3","gravatar_id":"","url":"https://api.github.com/users/jjappi","html_url":"https://github.com/jjappi","followers_url":"https://api.github.com/users/jjappi/followers","following_url":"https://api.github.com/users/jjappi/following{/other_user}","gists_url":"https://api.github.com/users/jjappi/gists{/gist_id}","starred_url":"https://api.github.com/users/jjappi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjappi/subscriptions","organizations_url":"https://api.github.com/users/jjappi/orgs","repos_url":"https://api.github.com/users/jjappi/repos","events_url":"https://api.github.com/users/jjappi/events{/privacy}","received_events_url":"https://api.github.com/users/jjappi/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T15:38:13Z","updated_at":"2015-10-29T15:38:13Z","body":"+1"}}