Skip to content

Commit

Permalink
feat(cli): set supported fargate regions as options to --region flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Jan 2, 2024
1 parent b849b3f commit 960b5ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 3 additions & 1 deletion packages/artillery/lib/cmds/run-fargate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const telemetry = require('../telemetry').init();
const { Plugin: CloudPlugin } = require('../platform/cloud/cloud');

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

Expand Down Expand Up @@ -66,7 +67,8 @@ RunCommand.flags = {
}),
region: Flags.string({
char: 'r',
description: 'The AWS region to run in'
description: 'The AWS region to run in',
options: supportedRegions
}),
secret: Flags.string({
multiple: true,
Expand Down
12 changes: 0 additions & 12 deletions packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,6 @@ async function tryRunCluster(scriptPath, options, artilleryReporter) {
taskArns: []
});

if (
typeof options.region !== 'undefined' &&
util.supportedRegions.indexOf(options.region) === -1
) {
console.log(
`Unsupported region (${
options.region
}) provided. Please specify one of: ${util.supportedRegions.join(', ')} `
);
process.exit(1);
}

if (typeof options.region !== 'undefined') {
context.region = options.region;
}
Expand Down

0 comments on commit 960b5ae

Please sign in to comment.