Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mention the region for a lambda function in AWS using cli

I am trying to create a lambda function in a particular region using aws-cli. I am not sure how to create it. Looking at this doc and couldn't find any parameter related to region. http://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html

Thank you.

like image 962
viggy28 Avatar asked Apr 16 '26 21:04

viggy28


1 Answers

The region is a common option to all AWS CLI commands. If you want to explicitly include the region in your command, simply include --region us-east-1, for example, to run your command in the us-east-1 region.

If this parameter is not specified explicitly, it will be implicitly derived from your configuration. This could be environment variables, your CLI's config file, or even inherited from an IAM instance profile.

A safe command to verify this is aws lambda list-functions. This is a read-only command that lists your functions; it will only list functions in the region that was implicitly supplied via your configuation. You can explicitly supply a region to this function and observe that the results will change if you have functions in one region but not the other.

Further Reading

  • AWS Documentation - Configuring the AWS Command Line Interface
  • AWS Documentation - Configuration and Credential Files
  • AWS Documentation - AWS CLI Options
like image 66
Anthony Neace Avatar answered Apr 19 '26 13:04

Anthony Neace