2 Answers
- Newest
- Most votes
- Most comments
0
Hello.
See the "PutEncryptionConfiguration" row in the table in the documentation below.
I think it cannot be used because "aws:ResourceTag" is not listed in the "Condition keys" column of the "PutEncryptionConfiguration" line.
https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html#amazons3-bucket
-1
You can try setting up a bucket policy instead. This bucket policy enforce username ownership.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowEncryptionChangeByCreator",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:PutEncryptionConfiguration",
"Resource": "arn:aws:s3:::my-bucket",
"Condition": {
"StringEquals": {
"aws:PrincipalTag/CreatedBy": "${aws:username}"
}
}
}
]
}
The semantics of this statement are quite different. aws:PrincipalTag would look at the tags of the requesting principal, not those of the bucket resource.
Relevant content
asked 4 years ago
asked 3 years ago
- AWS OFFICIALUpdated 6 months ago

Thanks for answering Riku, is there a other way i can only allow the action for those buckets tagged like that
@vinaygamer Unfortunately no. When the permission evaluation doesn't consider resource tags, there's no way to restrict actions matching the permission based on resource tags.