Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amplify-e2e-core): update source of truth for supported regions #6988

Merged
merged 2 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1077,37 +1077,37 @@ jobs:
environment:
TEST_SUITE: src/__tests__/plugin.test.ts
CLI_REGION: ap-northeast-1
migration-node-function-amplify_e2e_tests:
schema-iterative-update-locking-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/migration/node.function.test.ts
TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts
CLI_REGION: ap-southeast-1
api_4-amplify_e2e_tests:
migration-node-function-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/api_4.test.ts
TEST_SUITE: src/__tests__/migration/node.function.test.ts
CLI_REGION: ap-southeast-2
schema-iterative-update-locking-amplify_e2e_tests:
function_5-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts
TEST_SUITE: src/__tests__/function_5.test.ts
CLI_REGION: us-east-2
function_5-amplify_e2e_tests:
api_4-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/function_5.test.ts
TEST_SUITE: src/__tests__/api_4.test.ts
CLI_REGION: us-west-2
schema-iterative-update-4-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
Expand Down Expand Up @@ -1719,44 +1719,44 @@ jobs:
TEST_SUITE: src/__tests__/plugin.test.ts
CLI_REGION: ap-northeast-1
steps: *ref_5
migration-node-function-amplify_e2e_tests_pkg_linux:
schema-iterative-update-locking-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/migration/node.function.test.ts
TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts
CLI_REGION: ap-southeast-1
steps: *ref_5
api_4-amplify_e2e_tests_pkg_linux:
migration-node-function-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/api_4.test.ts
TEST_SUITE: src/__tests__/migration/node.function.test.ts
CLI_REGION: ap-southeast-2
steps: *ref_5
schema-iterative-update-locking-amplify_e2e_tests_pkg_linux:
function_5-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts
TEST_SUITE: src/__tests__/function_5.test.ts
CLI_REGION: us-east-2
steps: *ref_5
function_5-amplify_e2e_tests_pkg_linux:
api_4-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/function_5.test.ts
TEST_SUITE: src/__tests__/api_4.test.ts
CLI_REGION: us-west-2
steps: *ref_5
workflows:
Expand Down Expand Up @@ -1854,11 +1854,11 @@ workflows:
- hostingPROD-amplify_e2e_tests
- amplify-app-amplify_e2e_tests
- init-amplify_e2e_tests
- schema-iterative-update-locking-amplify_e2e_tests
- function_5-amplify_e2e_tests
- predictions-amplify_e2e_tests
- schema-predictions-amplify_e2e_tests
- amplify-configure-amplify_e2e_tests
- function_5-amplify_e2e_tests
- api_4-amplify_e2e_tests
- function_3-amplify_e2e_tests
- containers-api-amplify_e2e_tests
- interactions-amplify_e2e_tests
Expand All @@ -1874,22 +1874,22 @@ workflows:
- schema-key-amplify_e2e_tests
- analytics-amplify_e2e_tests
- notifications-amplify_e2e_tests
- migration-node-function-amplify_e2e_tests
- schema-iterative-update-locking-amplify_e2e_tests
- schema-auth-10-amplify_e2e_tests
- hosting-amplify_e2e_tests
- tags-amplify_e2e_tests
- api_4-amplify_e2e_tests
- migration-node-function-amplify_e2e_tests
- done_with_pkg_linux_e2e_tests:
context: amplify-cli-ecr
requires:
- hostingPROD-amplify_e2e_tests_pkg_linux
- amplify-app-amplify_e2e_tests_pkg_linux
- init-amplify_e2e_tests_pkg_linux
- schema-iterative-update-locking-amplify_e2e_tests_pkg_linux
- function_5-amplify_e2e_tests_pkg_linux
- predictions-amplify_e2e_tests_pkg_linux
- schema-predictions-amplify_e2e_tests_pkg_linux
- amplify-configure-amplify_e2e_tests_pkg_linux
- function_5-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux
- function_3-amplify_e2e_tests_pkg_linux
- containers-api-amplify_e2e_tests_pkg_linux
- interactions-amplify_e2e_tests_pkg_linux
Expand All @@ -1905,11 +1905,11 @@ workflows:
- schema-key-amplify_e2e_tests_pkg_linux
- analytics-amplify_e2e_tests_pkg_linux
- notifications-amplify_e2e_tests_pkg_linux
- migration-node-function-amplify_e2e_tests_pkg_linux
- schema-iterative-update-locking-amplify_e2e_tests_pkg_linux
- schema-auth-10-amplify_e2e_tests_pkg_linux
- hosting-amplify_e2e_tests_pkg_linux
- tags-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux
- migration-node-function-amplify_e2e_tests_pkg_linux
- amplify_migration_tests_latest:
context: amplify-cli-ecr
filters:
Expand Down Expand Up @@ -2059,7 +2059,7 @@ workflows:
filters: *ref_8
requires:
- schema-auth-7-amplify_e2e_tests
- schema-iterative-update-locking-amplify_e2e_tests:
- function_5-amplify_e2e_tests:
context: amplify-cli-ecr
post-steps: *ref_7
filters: *ref_8
Expand Down Expand Up @@ -2119,7 +2119,7 @@ workflows:
filters: *ref_8
requires:
- auth_4-amplify_e2e_tests
- function_5-amplify_e2e_tests:
- api_4-amplify_e2e_tests:
context: amplify-cli-ecr
post-steps: *ref_7
filters: *ref_8
Expand Down Expand Up @@ -2335,7 +2335,7 @@ workflows:
filters: *ref_8
requires:
- schema-searchable-amplify_e2e_tests
- migration-node-function-amplify_e2e_tests:
- schema-iterative-update-locking-amplify_e2e_tests:
context: amplify-cli-ecr
post-steps: *ref_7
filters: *ref_8
Expand Down Expand Up @@ -2389,7 +2389,7 @@ workflows:
filters: *ref_8
requires:
- schema-auth-8-amplify_e2e_tests
- api_4-amplify_e2e_tests:
- migration-node-function-amplify_e2e_tests:
context: amplify-cli-ecr
post-steps: *ref_7
filters: *ref_8
Expand Down Expand Up @@ -2457,7 +2457,7 @@ workflows:
filters: *ref_10
requires:
- schema-auth-7-amplify_e2e_tests_pkg_linux
- schema-iterative-update-locking-amplify_e2e_tests_pkg_linux:
- function_5-amplify_e2e_tests_pkg_linux:
context: amplify-cli-ecr
post-steps: *ref_9
filters: *ref_10
Expand Down Expand Up @@ -2521,7 +2521,7 @@ workflows:
filters: *ref_10
requires:
- auth_4-amplify_e2e_tests_pkg_linux
- function_5-amplify_e2e_tests_pkg_linux:
- api_4-amplify_e2e_tests_pkg_linux:
context: amplify-cli-ecr
post-steps: *ref_9
filters: *ref_10
Expand Down Expand Up @@ -2753,7 +2753,7 @@ workflows:
filters: *ref_10
requires:
- schema-searchable-amplify_e2e_tests_pkg_linux
- migration-node-function-amplify_e2e_tests_pkg_linux:
- schema-iterative-update-locking-amplify_e2e_tests_pkg_linux:
context: amplify-cli-ecr
post-steps: *ref_9
filters: *ref_10
Expand Down Expand Up @@ -2811,7 +2811,7 @@ workflows:
filters: *ref_10
requires:
- schema-auth-8-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux:
- migration-node-function-amplify_e2e_tests_pkg_linux:
context: amplify-cli-ecr
post-steps: *ref_9
filters: *ref_10
Expand Down
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 @@ -14,7 +14,7 @@ const defaultSettings = {
userName: '\r',
};

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

const profileOptions = ['cancel', 'update', 'remove'];
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 @@ -19,21 +20,6 @@ const defaultSettings = {
disableCIDetection: false,
};

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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this list identical to what we had?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, although not sorted in the same order. Here is where they come from.


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