- Newest
- Most votes
- Most comments
Hello.
If you are using SSE-S3, you should be able to download without setting up access to KMS.
Does the bucket policy of the S3 bucket allow access from the AWS account that owns Lambda?
You need to configure your S3 bucket policy to allow the IAM role for Lambda.
The documentation below relates to uploads, but I think you should do the same for downloads.
https://repost.aws/knowledge-center/access-denied-lambda-s3-bucket
Try configuring the bucket policy as shown below to allow "s3:GetObject" from the Lambda IAM role.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws-us-gov:iam::AccountA:role/LambdaRole"
},
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws-us-gov:s3:::aws-controltower-logs-123456789012-us-gov-east-1/*"
]
}
]
}
By the way, cross-account access only works within the same partition.
Therefore, if S3 is hosted on GovCloud, Lambda must also be hosted on GovCloud.
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html
IAM roles and resource-based policies delegate access across accounts only within a single partition. For example, you have an account in US West (N. California) in the standard aws partition. You also have an account in China in the aws-cn partition. You can't use a resource-based policy in your account in China to allow access for users in your standard AWS account.
Relevant content
- asked 2 years ago
