IAM - Add Validation on duplicate role names
This commit is contained in:
parent
e750e3ace0
commit
422bca8e90
2 changed files with 25 additions and 0 deletions
|
|
@ -898,6 +898,10 @@ class IAMBackend(BaseBackend):
|
|||
permissions_boundary
|
||||
),
|
||||
)
|
||||
if [role for role in self.get_roles() if role.name == role_name]:
|
||||
raise EntityAlreadyExists(
|
||||
"Role with name {0} already exists.".format(role_name)
|
||||
)
|
||||
|
||||
clean_tags = self._tag_verification(tags)
|
||||
role = Role(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue