I have created a lambda function via the web console and when I try to setup the trigger S3 using my bucket I got this error:
Is obvious that I need to change the region because my bucket is on "us-west-2" and the function is on "us-east-1" but this is the thing:
In the creation process I did not see an option to select the region for the function and in edition mode I have checked all places searching an option to update the region but I could not find it.
What I am missing?
When working with AWS Lambda functions, the question of region is one of the first you need to answer. As each Lambda function lives in a specific AWS region, and each AWS region has a slightly different set of functionality, you may find yourself having to work with functions in multiple regions on a regular basis.
Open the Functions page of the Lambda console. Choose a function and then choose Versions. On the versions configuration page, choose Publish new version. (Optional) Enter a version description.
Open the Functions page of the Lambda console. Choose a function. Choose Configuration and then choose Permissions. Scroll down to Resource-based policy and then choose View policy document.
To get the AWS Region where your Lambda Function is running we need to access the Environment Variable AWS_REGION. To access the environment variable AWS_REGION using Node.js Lambda Function we can use process.env.AWS_REGION. I launched a Lambda Function in Mumbai (ap-south-1) region and used the following javascript code.
AWS_REGION – The AWS Region where the Lambda function is executed. AWS_EXECUTION_ENV – The runtime identifier , prefixed by AWS_Lambda_ —for example, AWS_Lambda_java8 . AWS_LAMBDA_FUNCTION_NAME – The name of the function.
Can I use lambda across regions? AWS Lambda is a regional service. A single Lambda function in a single region can make API calls to AWS services in other regions, but they're remote, of course, so any data transferred between that Lambda function and the destination services or vice-versa takes longer and costs more.
See Upload the Code to create one using the Toolkit for Eclipse. Sign in to the AWS Management Console. From the Services menu, open the IAM console. In the Navigation pane, choose Roles, and then choose Create role. For Select type of trusted entity, choose AWS service, and then choose Lambda for the service that will use this role.
Like Mark B said in comments. You need to select the region before to create the function.
On the AWS Lambda "admin home" page there is a dropdown
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