I currently try to use AWS Lambda. The lambda function should load the zip file (> 10 MB) from an S3 Bucket. The S3 bucket is located in eu-central-1
while the lambda function is in lambda:us-east-1
.
When I try to save the lambda function, I get:
Error occurred while GetObject. S3 Error Code: AuthorizationHeaderMalformed. S3 Error Message: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-central-1'
Is that really the problem? Is it possible to move the lambda function?
The IAM role which executes the Lambda function has the AmazonS3FullAccess
policy.
The lambda function has to be in the same region as the S3 bucket you specify at "S3 link URL*":
You can access an S3 bucket in a different region from Lambda. If you are using Python boto3 library, the following code will help you:
import boto3
client = boto3.client('s3', region_name='eu-central-1')
In fact you can access any resource in a different region from AWS Lambda.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With