Notes based on Stéphane Maarek's Udemy course.
Effect
, Action
, Resource
, Conditions
and Policy Variables
DENY
has precedence over ALLOW
AdministratorAccess
PowerUserAccess
: does not allow anything regarding to IAM, organizations and account (with some exceptions), otherwise similar to admin accessIAM policy condition:
"Condition": {
"{condition-operator}": {
"{condition-key}": "{condition-value}"
}
}
StringEquals
, StringNotEquals
, StringLike
, etc.NumericEquals
, NumericNotEquals
, NumericLessThan
, etc.DateEquals
, DateNotEquals
, DateLessThan
, etc."Condition": {"IpAddress": {"aws:SourceIp": "192.168.0.1/16"}}
"Condition": {"Null": {"aws:TokenIssueTime": "192.168.0.1/16"}}
${aws:username}
: example "Resource:["arn:aws:s3:::mybucket/${aws:username}/*"]
aws:CurrentTime
aws:TokenIssueTime
aws:PrincipalType
: indicates if the principal is an account, user, federated or assumed roleaws:SecureTransport
aws:SourceIp
aws:UserId
ec2:SourceInstanceARN
s3:prefix
s3:max-keys
sns:EndPoint
sns:Protocol
iam:ResourceTag/key-name
iam:PrincipalTag/key-name
--dry-run
option to simulate API calls. This can be used to test permissions.Request would have succeeded, but DryRun flag is set
An error occurred (UnauthorizedOperation) when calling the {policy_name} operation