What is best practice for creating IAM stuff for the whole infrastructure. I was thinking to splitting up into this format:-
โโโ Modules
โโโ Dev
โ โโโ users
โ โ โโโ user1.tf
โ โ โโโ user2.tf
โ โ โโโ user3.tf
โ โ โโโ terraform.tfstate
โ โโโ groups
โ โ โโโ group1.tf
โ โ โโโ group2.tf
โ โ โโโ group3.tf
โ โ โโโ terraform.tfstate
โ โโโ roles
โ โ โโโ role1.tf
โ โ โโโ role2.tf
โ โ โโโ role3.tf
โ โ โโโ terraform.tfstate
โโโ Prod
โ โโโ users
โ โ โโโ user1.tf
โ โ โโโ user2.tf
โ โ โโโ user3.tf
โ โ โโโ terraform.tfstate
โ โโโ groups
โ โ โโโ group1.tf
โ โ โโโ group2.tf
โ โ โโโ group3.tf
โ โ โโโ terraform.tfstate
โ โโโ roles
โ โ โโโ role1.tf
โ โ โโโ role2.tf
โ โ โโโ role3.tf
โ โ โโโ terraform.tfstate
โโโ
This way whenever user/group/role no longer required i could simply delete the tf file and terraform apply will remove the exisiting IAM resource. I would like to know how you guys are implementing it.
Hi @zerolaser
Thanks for checking in with us on this :) Luckily, we have a best-practices repo that may be able to give you some insight :)
Hopefully it helps
Please let us know if it doesn't
Paul
@stack72 I have gone through the best-practices and it helped me re-write the module in a better way. But my actual question was how multiple IAM resources are handled? Should all the IAM resources should be handled in a single state file or an individual state file for each application?
Admin and Super Admin ,Terraform was throwing an error user already exists. I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
@stack72 I have gone through the best-practices and it helped me re-write the module in a better way. But my actual question was how multiple IAM resources are handled? Should all the IAM resources should be handled in a single state file or an individual state file for each application?
AdminandSuper Admin,Terraform was throwing an error user already exists.