Skip to content

Commit f247b9f

Browse files
Merge pull request #1855 from contentstack/feat/DX-2346
[DX-2346], Added regions in config
2 parents 57ea34f + 6304993 commit f247b9f

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

packages/contentstack-config/src/commands/config/set/region.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
120120
this.logger.error('failed to set the region', error);
121121
cliux.error(`Failed to set region due to: ${error.message}`);
122122
}
123-
} else if (['NA', 'EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
123+
} else if (['NA', 'EU', 'AWS-NA', 'AWS-EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
124124
const regionDetails: Region = regionHandler.setRegion(selectedRegion);
125125
await authHandler.setConfigData('logout'); //Todo: Handle this logout flow well through logout command call
126126
cliux.success(`Region has been set to ${regionDetails.name}`);

packages/contentstack-config/src/utils/interactive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export const askRegions = async (): Promise<string> => {
88
choices: [
99
{ name: 'NA', value: 'NA' },
1010
{ name: 'EU', value: 'EU' },
11-
{ name: 'AWS-NA', value: 'NA' },
12-
{ name: 'AWS-EU', value: 'EU' },
11+
{ name: 'AWS-NA', value: 'AWS-NA' },
12+
{ name: 'AWS-EU', value: 'AWS-EU' },
1313
{ name: 'AZURE-NA', value: 'AZURE-NA' },
1414
{ name: 'AZURE-EU', value: 'AZURE-EU' },
1515
{ name: 'GCP-NA', value: 'GCP-NA' },

packages/contentstack-config/src/utils/region-handler.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ const regions = {
2626
launchHubUrl: 'https://launch-api.contentstack.com',
2727
personalizeUrl: 'https://personalize-api.contentstack.com',
2828
},
29+
'AWS-NA': {
30+
name: 'AWS-NA',
31+
cma: 'https://api.contentstack.io',
32+
cda: 'https://cdn.contentstack.io',
33+
uiHost: 'https://app.contentstack.com',
34+
developerHubUrl: 'https://developerhub-api.contentstack.com',
35+
launchHubUrl: 'https://launch-api.contentstack.com',
36+
personalizeUrl: 'https://personalize-api.contentstack.com',
37+
},
2938
EU: {
3039
name: 'EU',
3140
cma: 'https://eu-api.contentstack.com',
@@ -35,6 +44,15 @@ const regions = {
3544
launchHubUrl: 'https://eu-launch-api.contentstack.com',
3645
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
3746
},
47+
'AWS-EU': {
48+
name: 'AWS-EU',
49+
cma: 'https://eu-api.contentstack.com',
50+
cda: 'https://eu-cdn.contentstack.com',
51+
uiHost: 'https://eu-app.contentstack.com',
52+
developerHubUrl: 'https://eu-developerhub-api.contentstack.com',
53+
launchHubUrl: 'https://eu-launch-api.contentstack.com',
54+
personalizeUrl: 'https://eu-personalize-api.contentstack.com',
55+
},
3856
'AZURE-NA': {
3957
name: 'AZURE-NA',
4058
cma: 'https://azure-na-api.contentstack.com',

0 commit comments

Comments
 (0)