1 Answer
- Newest
- Most votes
- Most comments
0
I don't think that condition is available in that context.
As an alternative, could you tag (environment=prod) the role that is assigned the the Lambda functions with Prod alias. Then use the "aws:PrincipalTag" to control access to the operation/object
"Sid": "S3Prod",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket-data/*",
"Condition": {
"StringEquals": { "aws:PrincipalTag/environment": "prod" }
}
Relevant content
- asked 4 years ago
- asked 9 years ago
- asked 6 years ago
- AWS OFFICIALUpdated a month ago

I think the condition is available because access is granted if I do something like
it does match, but it seems to me that
lambda:SourceFunctionArnis literally the function arn without any version/alias suffixed to it...I was looking at the tags as well, but the tags are only applied at the un-aliased function, and there doesn't seem to be a way to add a tag to a function alias - at least I don't see it in the console.
Yes, and aliases/version don't have their own role, sorry. Have you tried this: "lambda:SourceFunctionArn": ":Prod"? Or "lambda:SourceFunctionArn": ":<function-name>:Prod"?