{"action":"created","issue":{"url":"https://api.github.com/repos/dtan4/terraforming/issues/277","repository_url":"https://api.github.com/repos/dtan4/terraforming","labels_url":"https://api.github.com/repos/dtan4/terraforming/issues/277/labels{/name}","comments_url":"https://api.github.com/repos/dtan4/terraforming/issues/277/comments","events_url":"https://api.github.com/repos/dtan4/terraforming/issues/277/events","html_url":"https://github.com/dtan4/terraforming/issues/277","id":180639144,"number":277,"title":"aws_iam_user_policy resource name can only contain letters, numbers, dashes, and underscores.","user":{"login":"kim-toms","id":21068,"avatar_url":"https://avatars.githubusercontent.com/u/21068?v=3","gravatar_id":"","url":"https://api.github.com/users/kim-toms","html_url":"https://github.com/kim-toms","followers_url":"https://api.github.com/users/kim-toms/followers","following_url":"https://api.github.com/users/kim-toms/following{/other_user}","gists_url":"https://api.github.com/users/kim-toms/gists{/gist_id}","starred_url":"https://api.github.com/users/kim-toms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kim-toms/subscriptions","organizations_url":"https://api.github.com/users/kim-toms/orgs","repos_url":"https://api.github.com/users/kim-toms/repos","events_url":"https://api.github.com/users/kim-toms/events{/privacy}","received_events_url":"https://api.github.com/users/kim-toms/received_events","type":"User","site_admin":false},"labels":[{"id":191688161,"url":"https://api.github.com/repos/dtan4/terraforming/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-03T13:23:01Z","updated_at":"2016-12-26T10:16:57Z","closed_at":null,"body":"I used terraforming to extract the configuration of my account in AWS (which had been built artisanally), and later **terraform plan** complained that one users policy which had his user name as \"user.name\" had the above listed problem.\n\nChecking in the console indicated that the Policy Name actually had a period in it, so I'm not sure if the problem is in Terraform or Terraforming.\n"},"comment":{"url":"https://api.github.com/repos/dtan4/terraforming/issues/comments/269196390","html_url":"https://github.com/dtan4/terraforming/issues/277#issuecomment-269196390","issue_url":"https://api.github.com/repos/dtan4/terraforming/issues/277","id":269196390,"user":{"login":"nabarunchatterjee","id":3935859,"avatar_url":"https://avatars.githubusercontent.com/u/3935859?v=3","gravatar_id":"","url":"https://api.github.com/users/nabarunchatterjee","html_url":"https://github.com/nabarunchatterjee","followers_url":"https://api.github.com/users/nabarunchatterjee/followers","following_url":"https://api.github.com/users/nabarunchatterjee/following{/other_user}","gists_url":"https://api.github.com/users/nabarunchatterjee/gists{/gist_id}","starred_url":"https://api.github.com/users/nabarunchatterjee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nabarunchatterjee/subscriptions","organizations_url":"https://api.github.com/users/nabarunchatterjee/orgs","repos_url":"https://api.github.com/users/nabarunchatterjee/repos","events_url":"https://api.github.com/users/nabarunchatterjee/events{/privacy}","received_events_url":"https://api.github.com/users/nabarunchatterjee/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T10:16:57Z","updated_at":"2016-12-26T10:16:57Z","body":"Facing the same problem. Dug a bit deeper and saw  that while the resource names for some iam modules e.g. iam_user were being [normalized](https://github.com/dtan4/terraforming/blob/master/lib/terraforming/util.rb#L12) as can be seen [here](https://github.com/dtan4/terraforming/blob/master/lib/terraforming/resource/iam_user.rb#L32) and [here](https://github.com/dtan4/terraforming/blob/master/lib/terraforming/template/tf/iam_user.erb#L2) using the function [module_name_of](https://github.com/dtan4/terraforming/blob/master/lib/terraforming/resource/iam_user.rb#L50), other modules like instance_profile, user_policy etc were not getting normalized.\r\n\r\nHere is a sample output of the command\r\n\r\n> terraform plan\r\n\r\n`Errors:\r\n\r\n  * aws_iam_user_policy.XXX.YYY_policygen-XXX.YYY-ZZZZZZZ: XXX.YYY_policygen-XXX.YYY-ZZZZZZZ: resource name can only contain letters, numbers, dashes, and underscores.`\r\n\r\nThe same problem also occurs while importing state file.\r\n\r\nWill send PR if I get some time.\r\n"}}
{"actor":{"display_login":"nabarunchatterjee"}}