Fixes for IAM Groups
This commit is contained in:
parent
2bb3d07e11
commit
8ae1a2b357
3 changed files with 34 additions and 2 deletions
|
|
@ -255,7 +255,15 @@ class Group(BaseModel):
|
|||
|
||||
@property
|
||||
def arn(self):
|
||||
return "arn:aws:iam::{0}:group/{1}".format(ACCOUNT_ID, self.path)
|
||||
if self.path == '/':
|
||||
return "arn:aws:iam::{0}:group/{1}".format(ACCOUNT_ID, self.name)
|
||||
|
||||
else:
|
||||
return "arn:aws:iam::{0}:group/{1}/{2}".format(ACCOUNT_ID, self.path, self.name)
|
||||
|
||||
@property
|
||||
def create_date(self):
|
||||
return self.created
|
||||
|
||||
def get_policy(self, policy_name):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class IamResponse(BaseResponse):
|
|||
|
||||
def create_group(self):
|
||||
group_name = self._get_param('GroupName')
|
||||
path = self._get_param('Path')
|
||||
path = self._get_param('Path', '/')
|
||||
|
||||
group = iam_backend.create_group(group_name, path)
|
||||
template = self.response_template(CREATE_GROUP_TEMPLATE)
|
||||
|
|
@ -1007,6 +1007,7 @@ CREATE_GROUP_TEMPLATE = """<CreateGroupResponse>
|
|||
<GroupName>{{ group.name }}</GroupName>
|
||||
<GroupId>{{ group.id }}</GroupId>
|
||||
<Arn>{{ group.arn }}</Arn>
|
||||
<CreateDate>{{ group.create_date }}</CreateDate>
|
||||
</Group>
|
||||
</CreateGroupResult>
|
||||
<ResponseMetadata>
|
||||
|
|
@ -1021,6 +1022,7 @@ GET_GROUP_TEMPLATE = """<GetGroupResponse>
|
|||
<GroupName>{{ group.name }}</GroupName>
|
||||
<GroupId>{{ group.id }}</GroupId>
|
||||
<Arn>{{ group.arn }}</Arn>
|
||||
<CreateDate>{{ group.create_date }}</CreateDate>
|
||||
</Group>
|
||||
<Users>
|
||||
{% for user in group.users %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue