IAM - Add Validation on duplicate policy names

This commit is contained in:
Bert Blommers 2019-11-11 09:14:22 +00:00
commit 85570f0abe
2 changed files with 17 additions and 1 deletions

View file

@ -820,7 +820,7 @@ class IAMBackend(BaseBackend):
)
if policy.arn in self.managed_policies:
raise EntityAlreadyExists(
"A policy called {} already exists. Duplicate names are not allowed.".format(
"A policy called {0} already exists. Duplicate names are not allowed.".format(
policy_name
)
)