https://github.com/aws-samples/example-permissions-boundary
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceActionsHaveBoundary",
"Effect": "Deny",
"Action": [
"iam:AttachRolePolicy",
"iam:CreateRole",
"iam:DetachRolePolicy",
"iam:PutRolePolicy",
"iam:DeleteRolePolicy",
"iam:PutRolePermissionsBoundary"
],
"Resource": "*",
"Condition": {
"StringNotLike": {
"iam:PermissionsBoundary": "arn:aws:iam::*:policy/permissionboundarypolicy"
}
}
},
{
"Sid": "DenyChangesToBoundaryPolicy",
"Effect": "Deny",
"Action": [
"iam:DeletePolicy",
"iam:CreatePolicyVersion",
"iam:CreatePolicy",
"iam:DeletePolicyVersion",
"iam:SetDefaultPolicyVersion"
],
"Resource": "arn:aws:iam::*:policy/permissionboundarypolicy"
}
]
}