Configure Regions in the CLI

View as Markdown
Intermediate4 min readLast updated September 8, 2026

Overview

The config namespace contains commands to configure the CLI. Contentstack supports multiple regions across different cloud providers. You can configure the CLI to use a specific region for all operations.

Supported Regions:

Cloud ProviderRegionArgument
AWSNorth AmericaAWS-NA
AWSEuropeAWS-EU
AWSAustraliaAWS-AU
AzureNorth AmericaAZURE-NA
AzureEuropeAZURE-EU
Google Cloud PlatformNorth AmericaGCP-NA
Google Cloud PlatformEuropeGCP-EU

You can also configure custom hosts for different APIs and set a custom region name.


Prerequisites

What You Will Learn

  • How to view the region the CLI is currently using.

  • How to set a predefined region for CLI operations.

  • How to select a region interactively.

  • How to configure a custom region with custom API hosts.


Common Commands

Get Current Region

csdx config:get:region

Set Region

# Interactive selection
csdx config:set:region

# Or specify region directly
csdx config:set:region AWS-NA

Get Region

Get the currently configured region.

Command: csdx config:get:region

Usage:

csdx config:get:region

Example:

csdx config:get:region
# Output: AWS-NA

Set Region

Set the region for CLI operations. You can choose from predefined regions or configure custom hosts.

Command: csdx config:set:region

Set Predefined Region

Usage:

csdx config:set:region <region>

Available Regions:

  • AWS-NA - AWS North America
  • AWS-EU - AWS Europe
  • AWS-AU - AWS Australia
  • AZURE-NA - Azure North America
  • AZURE-EU - Azure Europe
  • GCP-NA - Google Cloud Platform North America
  • GCP-EU - Google Cloud Platform Europe

Examples:

# Set AWS North America
csdx config:set:region AWS-NA

# Set AWS Europe
csdx config:set:region AWS-EU

# Set AWS Australia
csdx config:set:region AWS-AU

# Set Azure North America
csdx config:set:region AZURE-NA

# Set Azure Europe
csdx config:set:region AZURE-EU

# Set GCP North America
csdx config:set:region GCP-NA

# Set GCP Europe
csdx config:set:region GCP-EU

Interactive Region Selection

Run the command without arguments to interactively select a region:

csdx config:set:region

You'll be prompted to choose from available regions.


Set Custom Host and Region

Configure custom hosts for Content Delivery API (CDA), Content Management API (CMA), UI Host, Developer Hub, Launch, and Personalize APIs, and set a custom region name.

Command: csdx config:set:region

Usage:

csdx config:set:region \
  --cda <custom_cda_host_url> \
  --cma <custom_cma_host_url> \
  --ui-host <custom_ui_host_url> \
  -n <custom_region_name> \
  [--developer-hub <custom_developer_hub_url>] \
  [--launch <custom_launch_url>] \
  [--personalize <custom_personalize_url>]

Options:

FlagTypeRequiredDefaultDescriptionNotes
--cda, -dstringConditional*-Custom host for Content Delivery API. If used, --cma, --ui-host, and -n are required
--cma, -mstringConditional*-Custom host for Content Management API. If used, --cda, --ui-host, and -n are required
--ui-hoststringConditional*-Custom UI host for CLI. If used, --cda, --cma, and -n are required
--name, -nstringConditional*-Name for the custom region. If used, --cda, --cma, and --ui-host are required
--developer-hubstringNo-Custom host for Developer Hub API
--launchstringNo-Custom host for Launch API
--personalizestringNo-Custom host for Personalize Management API

* If any of --cda, --cma, --ui-host, or -n is used, all four are required.

Note When configuring a custom region, the CLI automatically generates Developer Hub, Launch, Personalize, and Asset Management API hosts from the CMA URL.

Example:

csdx config:set:region \
  --cda "https://in-cdn.contentstack.com" \
  --cma "https://in-api.contentstack.com" \
  --ui-host "https://in-app.contentstack.com" \
  --developer-hub "https://in-developerhub-api.contentstack.com" \
  --launch "https://in-launch-api.contentstack.com" \
  --personalize "https://in-personalize-api.contentstack.com" \
  -n "India"

Examples

Example 1: Configure Region for Different Environments

# Development - AWS North America
csdx config:set:region AWS-NA

# Staging - AWS Europe
csdx config:set:region AWS-EU

# Production - Azure North America
csdx config:set:region AZURE-NA

Example 2: Configure Custom Region

# Set custom region with all required hosts
csdx config:set:region \
  --cda "https://custom-cdn.example.com" \
  --cma "https://custom-api.example.com" \
  --ui-host "https://custom-ui.example.com" \
  -n "Custom Region"

Example 3: Configure Custom Region with Optional APIs

# Set custom region with Developer Hub, Launch, and Personalize
csdx config:set:region \
  --cda "https://custom-cdn.example.com" \
  --cma "https://custom-api.example.com" \
  --ui-host "https://custom-ui.example.com" \
  --developer-hub "https://custom-developerhub.example.com" \
  --launch "https://custom-launch.example.com" \
  --personalize "https://custom-personalize.example.com" \
  -n "Custom Region"

Example 4: Check Current Region

# Get current region
csdx config:get:region

# Change region
csdx config:set:region AWS-EU

# Verify change
csdx config:get:region

Additional Resource

For more information, refer to the following documents:

Limitations

  • The region argument accepts only the predefined list: NA, EU, AU, AWS-NA, AWS-EU, AWS-AU, AZURE-NA, AZURE-EU, GCP-NA, GCP-EU. Any other value is rejected.
  • A custom region requires --cda, --cma, --ui-host, and --name together. None of the four can be set on its own.