# Get region in variable resolver function

**URL:** <https://forum.serverless.com/t/get-region-in-variable-resolver-function/15496>\
**Category:** Serverless Framework\
**Tags:** aws, variables\
**Created:** [July 5, 2021, 1:27pm UTC](https://forum.serverless.com/t/get-region-in-variable-resolver-function/15496 "2021-07-05T13:27:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/deepak/32/5627_2.png) [@deepak](https://forum.serverless.com/u/deepak)\
**Post date:** [July 5, 2021, 1:27pm UTC](https://forum.serverless.com/t/get-region-in-variable-resolver-function/15496/1 "2021-07-05T13:27:37Z")

</div>

I have a function that is calling an AWS service to get some data that needs to be configured in my serverless.yml file.  
Using Reference Variables in Javascript Files([link](https://www.serverless.com/framework/docs/providers/aws/guide/variables/)), I am able to do that but I need access to my current region in order to call the service.  
Is there any way to get region inside the function?

I have a javascript file called myData.js which is referenced like this in my serverless.yml

```auto
functions:
  sourceLambda:
    handler: ./src/sourceLambda
    events: ${file(./myData.js)}

```

myData.js

```auto
module.exports = async ({options, resolveConfigurationProperty}) => {
// can we access region here
// the serverless parameters coming to this functions are empty
}

```
