Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

aws_iam_user_policy resource name can only contain letters, numbers, dashes, and underscores. #277

Closed
ghost opened this issue Oct 3, 2016 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 3, 2016

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.

Checking 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.

@dtan4 dtan4 added the bug label Oct 10, 2016
@dtan4
Copy link
Owner

dtan4 commented Nov 13, 2016

Sorry for late reply. Could you paste your tf (mask if needed) and the output of terraform plan if exists?

@nabarunchatterjee
Copy link
Contributor

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 as can be seen here and here using the function module_name_of, other modules like instance_profile, user_policy etc were not getting normalized.

Here is a sample output of the command

terraform plan

`Errors:

  • 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.`

The same problem also occurs while importing state file.

Will send PR if I get some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants