Skip to content

Commit

Permalink
fix(amplify-e2e-core): update source of truth for supported regions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig authored Apr 9, 2021
1 parent 139f44d commit bb8f8e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
5 changes: 3 additions & 2 deletions packages/amplify-e2e-core/src/configure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const defaultSettings = {
userName: '\r',
};

const regionOptions = [
export const amplifyRegions = [
'us-east-1',
'us-east-2',
'us-west-2',
Expand All @@ -25,6 +25,7 @@ const regionOptions = [
'ap-southeast-1',
'ap-southeast-2',
'ap-south-1',
'ca-central-1',
];

const configurationOptions = ['project', 'profile', 'containers'];
Expand All @@ -46,7 +47,7 @@ export function amplifyConfigure(settings: AmplifyConfiguration): Promise<void>
.sendCarriageReturn()
.wait('Specify the AWS Region');

singleSelect(chain, s.region, regionOptions);
singleSelect(chain, s.region, amplifyRegions);

chain
.wait('user name:')
Expand Down
16 changes: 1 addition & 15 deletions packages/amplify-e2e-core/src/init/initProjectHelper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { nspawn as spawn, getCLIPath, singleSelect, addCircleCITags } from '..';
import { KEY_DOWN_ARROW } from '../utils';
import { amplifyRegions } from '../configure';

const defaultSettings = {
name: '\r',
Expand All @@ -20,21 +21,6 @@ const defaultSettings = {
providerConfig: undefined,
};

export const amplifyRegions = [
'us-east-1',
'us-east-2',
'us-west-2',
'eu-west-1',
'eu-west-2',
'eu-central-1',
'ap-northeast-1',
'ap-northeast-2',
'ap-southeast-1',
'ap-southeast-2',
'ap-south-1',
'ca-central-1',
];

export function initJSProjectWithProfile(cwd: string, settings: Object): Promise<void> {
const s = { ...defaultSettings, ...settings };
let env;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// *** NOTE! ***
// If updating this list, also update the corresponding list in amplify-e2e-tests/src/configure/index.ts
// If updating this list, also update the corresponding list in amplify-e2e-core/src/configure/index.ts
// *** NOTE! ***
const regionMappings = {
'us-east-1': 'US East (N. Virginia)',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
const aws = require('aws-sdk');
const proxyAgent = require('proxy-agent');
const configurationManager = require('../configuration-manager');

const amplifyServiceRegions = [
'us-east-1',
'us-east-2',
'us-west-2',
'eu-west-1',
'eu-west-2',
'eu-central-1',
'ap-northeast-1',
'ap-northeast-2',
'ap-south-1',
'ap-southeast-1',
'ap-southeast-2',
'ca-central-1',
];
const { regions: amplifyServiceRegions } = require('../aws-regions');

async function getConfiguredAmplifyClient(context, options = {}) {
let cred = {};
Expand Down

0 comments on commit bb8f8e6

Please sign in to comment.