14-07-2022, 01:19 PM
(11-07-2022, 05:38 PM)ConImp Wrote: *API Response
Invalid principle in policy
"Principal": {
"AWS": [
"admin-w"
]
}
This is happening most likely due to the incorrect syntax for the principal element. It has to be listed with a proper ARN format. You can find this in the IAM details for the user you are attempting to give access to. Assuming you have created this user already. Example below:
Code:
"Principal": {
"AWS": "arn:aws:iam::111111111111:user/user-name1"
}
or for multiple usernames:
[font=Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace]"Principal": {
"AWS": [
"arn:aws:iam::111111111111:user/user-name1",
"arn:aws:iam::111111111111:user/user-name2"
]
}[/font]
More details on how to properly format the Principal element can be found here: https://docs.aws.amazon.com/IAM/latest/U...cipal.html