Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I edit the region of an aws lambda function already created?

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:

enter image description here

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?

like image 221
Saul Burgos Avatar asked Jan 05 '18 16:01

Saul Burgos


People also ask

Are Lambda functions region specific?

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.

How can you change between different versions of an AWS Lambda function?

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.

How do I edit Lambda function policy?

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.

How to get the AWS region where your lambda function is running?

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.

What is AWS_region in AWS Lambda?

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 in multiple regions?

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.

How do I create Lambda roles in AWS?

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.


1 Answers

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 enter image description here

like image 118
Saul Burgos Avatar answered Oct 05 '22 07:10

Saul Burgos