---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/global-infrastructure/functions-and-assets-with-twilio-regions#article
headline: Use Functions and Assets with Twilio Regions
description: Learn how Functions and Assets work in Twilio's Ireland (IE1) Region for EU data residency, including credentials, API endpoints, and deployment.
url: https://www.twilio.com/docs/global-infrastructure/functions-and-assets-with-twilio-regions
inLanguage: en
dateModified: 2026-11-18T22:10:37.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Use Functions and Assets with Twilio Regions

> \[!NOTE]
>
> Functions and Assets in IE1 are not PCI compliant or HIPAA Eligible Services and should not be used in workflows that are subject to HIPAA or PCI.

You can use [Functions and Assets](/docs/serverless/functions-assets) in Twilio's Ireland (IE1) Region for EU data residency. Functions and Assets in IE1 work the same way they do in US1, with the differences called out on this page. For the complete list of Twilio Regions and product availability, see [Regional product and feature availability][].

## Configure your account for IE1

To use Functions and Assets in IE1, complete the following steps:

1. In the Twilio Console, use the region selector to switch to **Ireland (IE1)**. When you set the Console to the IE1 region, created Services only run in IE1.
2. Use Region-specific credentials. Twilio isolates its Regions, so a US1 Auth Token or API key doesn't work when you target IE1. For details, see [Manage Regional API Credentials][].
   1. In the Console, go to **API keys & tokens**.
   2. Change the region selector to Ireland (IE1).
   3. Find your IE1 Auth Token.
   4. Create API keys with the Console region selector set to Ireland (IE1). Any keys you create only work in IE1.
3. Send Serverless API requests to the `dublin` edge with this base URL:

   | Resource       | Base URL                         |
   | -------------- | -------------------------------- |
   | Serverless API | serverless.dublin.ie1.twilio.com |

   Using the Twilio CLI, sign in with the IE1 region and the `dublin` edge.

   ```bash
   twilio login --region ie1 --edge dublin
   ```

   Using a Twilio helper library, pass both the region and the edge when you create the client. In Node.js:

   ```javascript
   const client = require('twilio')(accountSid, authToken, { region: 'ie1', edge: 'dublin' });
   ```

> \[!NOTE]
>
> For the [@twilio-labs/serverless-api](https://www.npmjs.com/package/@twilio-labs/serverless-api) library, you can pass `region` and `edge` when you initialize the client.

## Deploy a Service to IE1

To deploy a Service to IE1 with the Twilio CLI, complete the following steps:

1. Make sure that you have the [Twilio CLI](/docs/twilio-cli/quickstart) and version 3.1.2 or later of the [Serverless Toolkit](/docs/labs/serverless-toolkit) plugin installed.
2. Create an IE1 profile by signing in with the IE1 region and the `dublin` edge, as described in [Configure your account for IE1](#configure-your-account-for-ie1).
3. If you don't already have a Service, [create and develop](/docs/labs/serverless-toolkit/general-usage#create-a-project) one. Otherwise, skip to the next step.
4. Deploy your Service with the Serverless Toolkit, and specify the profile for IE1: `twilio serverless:deploy -p <YOUR_REGIONAL_PROFILE_NAME>`.

> \[!NOTE]
>
> If you use `twilio-run`, or if you want to pass credentials directly into your deployment command, you can use the `--region` flag. For example:
>
> ```bash
> twilio serverless:deploy \
>   --region=ie1 \
>   --username=<YOUR_TWILIO_REGIONAL_API_KEY> \
>   --password=<YOUR_TWILIO_REGIONAL_API_SECRET>
> ```

To host a Service in multiple Regions, you must deploy to each Region individually. The Console can't deploy a Service to multiple Regions at once. To use different environment variables for each Region, add your Account SID and the Region to the `projects` section of your `.twilioserverlessrc` [configuration file](/docs/labs/serverless-toolkit/configuration). For example:

```json
{
 "projects": {
   "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:us1": {
     "env": ".env"
   },
   "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:ie1": {
     "env": ".env.ie1"
   }
 }
}
```

> \[!WARNING]
>
> [Deployments](/docs/serverless/api/resource/deployment) that use [dependencies](/docs/serverless/functions-assets/functions/dependencies) still contact the npm registry to fetch them. Twilio doesn't control whether npm fetches those dependencies from the US.

## Service domains

The domain of a [Service](/docs/serverless/functions-assets/functions/create-service) includes its [Edge](/docs/global-infrastructure/understanding-edge-locations) and Region. Functions URLs with regional support use the following pattern:

```bash
<unique-name>-<random-four-digits>[-<optional-environment-suffix>].<edge>.<region>.twil.io
```

For example, a Service in IE1 might use `ahoy-1234.dublin.ie1.twil.io`.

## Identify the Region of a running Function

The [Runtime Handler](/docs/serverless/functions-assets/handler) provides Environment Variables that identify where a Function is running. You can use these in logs or any other logic:

* `context.TWILIO_REGION`
* `context.TWILIO_EDGE`

If `context.TWILIO_REGION` is `undefined` in a deployed Function, the Function is running in US1.

## Validate signatures across Regions

[Protected](/docs/serverless/functions-assets/visibility) Functions and Assets use signature validation to protect them from requests that don't originate from Twilio products and services, or from your own code that generates secure signatures.

Your Auth Token, which Twilio uses to generate these signatures, differs by Region. This means that Functions and Assets in one Region can only be triggered by Twilio products in that same Region. To send a request to a Protected Function or Asset in a different Region, [generate](/docs/usage/security#validating-requests) a valid `X-Twilio-Signature` header based on credentials from the Region where the Function or Asset is deployed.

## Keep Functions and their resources in the same Region

By default, Functions provide the [Auth Token](/docs/iam/api/authtoken) for the Region where the Function is deployed through `context.AUTH_TOKEN`, and use it to initialize the [built-in Twilio REST Client](/docs/serverless/functions-assets/functions/invocation#helper-methods) that `context.getTwilioClient()` returns. The default client can only make requests to Twilio products and APIs in the same Region. A Function that runs in IE1 can't reach a product that exists only in US1 without additional credentials.

### Use a product in another Region

> \[!CAUTION]
>
> If your Function interacts with Twilio services in a Region other than where your Function is deployed, the data for those requests is transmitted to and processed or stored in that Region.

To create a Twilio client that can communicate with Twilio products in a different Region, complete the following steps:

1. In the Console, [create a new API Key SID and Secret pair](https://www.twilio.com/console/runtime/api-keys/create).
2. Add the API Key SID and Secret as environment variables to your Service. For example, `TWILIO_US1_API_KEY_SID` and `TWILIO_US1_API_KEY_SECRET`.
3. In your Function, create a new Twilio client:

   ```javascript
   const clientUs1 = new Twilio(
    context.TWILIO_US1_API_KEY_SID,
    context.TWILIO_US1_API_KEY_SECRET,
    {
      region: 'us1',
      edge: 'ashburn',
      accountSid: context.TWILIO_ACCOUNT_SID
   });
   ```
4. Use this US-specific client to make requests to Twilio services in the US, even though your Function runs in another Region such as Ireland:

   ```javascript
   clientUs1.messages.create({
     from: context.US_PHONE_NUMBER,
     to: 'some other US number',
     body: 'Ahoy from another region!',
   })
   .then((message) => {
     console.log({ callSid: message.sid });
     return callback();
   })
   .catch((error) => {
     console.error(error);
     return callback(error);
   });
   ```

[Manage Regional API Credentials]: /docs/global-infrastructure/manage-regional-api-credentials

[Regional product and feature availability]: /docs/global-infrastructure/regional-product-and-feature-availability
