Skip to content

Commit 960b5ae

Browse files
feat(cli): set supported fargate regions as options to --region flag
1 parent b849b3f commit 960b5ae

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

packages/artillery/lib/cmds/run-fargate.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const telemetry = require('../telemetry').init();
88
const { Plugin: CloudPlugin } = require('../platform/cloud/cloud');
99

1010
const runCluster = require('../platform/aws-ecs/legacy/run-cluster');
11+
const { supportedRegions } = require('../platform/aws-ecs/legacy/util');
1112
const PlatformECS = require('../platform/aws-ecs/ecs');
1213
const { ECS_WORKER_ROLE_NAME } = require('../platform/aws/constants');
1314

@@ -66,7 +67,8 @@ RunCommand.flags = {
6667
}),
6768
region: Flags.string({
6869
char: 'r',
69-
description: 'The AWS region to run in'
70+
description: 'The AWS region to run in',
71+
options: supportedRegions
7072
}),
7173
secret: Flags.string({
7274
multiple: true,

packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js

-12
Original file line numberDiff line numberDiff line change
@@ -467,18 +467,6 @@ async function tryRunCluster(scriptPath, options, artilleryReporter) {
467467
taskArns: []
468468
});
469469

470-
if (
471-
typeof options.region !== 'undefined' &&
472-
util.supportedRegions.indexOf(options.region) === -1
473-
) {
474-
console.log(
475-
`Unsupported region (${
476-
options.region
477-
}) provided. Please specify one of: ${util.supportedRegions.join(', ')} `
478-
);
479-
process.exit(1);
480-
}
481-
482470
if (typeof options.region !== 'undefined') {
483471
context.region = options.region;
484472
}

0 commit comments

Comments
 (0)