Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set user name and group name in IAM using CloudFormation?

I created a CloudFormation template and I wanted to create IAM user, to do that I used this JSON string:

"CFNUser" : {
  "Type" : "AWS::IAM::User",
  "Properties" : {
    "LoginProfile": {
      "Password": { "Ref" : "AdminPassword" }
    }
  }
},

Then for group I used this:

"CFNUserGroup" : {
  "Type" : "AWS::IAM::Group"
},

After creating the stack, I got the following:

user name - IAMUsers-CFNUser-E1BT342YK7G6

group name - IAMUsers-CFNUserGroup-1UBUBRYALTIMI

So my question is, how can I set the user name here? same goes for the group name?

like image 645
Thor Avatar asked Apr 24 '13 06:04

Thor


People also ask

What are IAM users and groups?

An IAM user group is a collection of IAM users. User groups let you specify permissions for multiple users, which can make it easier to manage the permissions for those users. For example, you could have a user group called Admins and give that user group typical administrator permissions.

What IAM role does CloudFormation use?

A service role is an AWS Identity and Access Management (IAM) role that allows AWS CloudFormation to make calls to resources in a stack on your behalf.


1 Answers

After talking with one of the AWS support, at this time of writing, it is not possible to specify your own username and group name in IAM using CloudFormation template :-(

Maybe there's a reason why they do not allow user to do this...anyway it's good thing that I have answer to this question and I will be glad if someone find this useful.

like image 187
Thor Avatar answered Oct 02 '22 08:10

Thor