diff --git a/packages/amplify-e2e-core/src/configure/index.ts b/packages/amplify-e2e-core/src/configure/index.ts index b5b1428c3d2..b2a5d9ef410 100644 --- a/packages/amplify-e2e-core/src/configure/index.ts +++ b/packages/amplify-e2e-core/src/configure/index.ts @@ -13,7 +13,7 @@ const defaultSettings = { userName: '\r', }; -const regionOptions = [ +export const amplifyRegions = [ 'us-east-1', 'us-east-2', 'us-west-2', @@ -25,6 +25,7 @@ const regionOptions = [ 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', + 'ca-central-1', ]; const configurationOptions = ['project', 'profile', 'containers']; @@ -46,7 +47,7 @@ export function amplifyConfigure(settings: AmplifyConfiguration): Promise .sendCarriageReturn() .wait('Specify the AWS Region'); - singleSelect(chain, s.region, regionOptions); + singleSelect(chain, s.region, amplifyRegions); chain .wait('user name:') diff --git a/packages/amplify-e2e-core/src/init/initProjectHelper.ts b/packages/amplify-e2e-core/src/init/initProjectHelper.ts index b8182f5f30f..f129161b888 100644 --- a/packages/amplify-e2e-core/src/init/initProjectHelper.ts +++ b/packages/amplify-e2e-core/src/init/initProjectHelper.ts @@ -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', @@ -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 { const s = { ...defaultSettings, ...settings }; let env; diff --git a/packages/amplify-provider-awscloudformation/src/aws-regions.js b/packages/amplify-provider-awscloudformation/src/aws-regions.js index d7becdf5aa3..9c907177c20 100644 --- a/packages/amplify-provider-awscloudformation/src/aws-regions.js +++ b/packages/amplify-provider-awscloudformation/src/aws-regions.js @@ -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)', diff --git a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-amplify.js b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-amplify.js index ebcb825787c..8a3deeba456 100644 --- a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-amplify.js +++ b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-amplify.js @@ -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 = {};