Skip to content

Commit

Permalink
feat(ecs): add ability to set DNS servers and ephemeral storage size
Browse files Browse the repository at this point in the history
- --container-dns-servers can now be used to set the dnsServers setting
  for the Artillery container
- --ephemeral-storage can now be used to set the amount of ephemeral storage for the worker task
  • Loading branch information
hassy committed Aug 6, 2024
1 parent 4f6f322 commit 7b5c3d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/artillery/lib/cmds/run-fargate.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ RunCommand.flags = {
description:
'JSON to customize launch configuration of ECS/Fargate tasks (see https://www.artillery.io/docs/reference/cli/run-fargate#using---launch-config)'
}),
'container-dns-servers': Flags.string({
description:
'Comma-separated list of DNS servers for Artillery container. Maps to dnsServers parameter in ECS container definition'
}),
'task-ephemeral-storage': Flags.string({
description:
'Ephemeral storage in GiB for the worker task. Maps to ephemeralStorage parameter in ECS container definition',
default: '20',
type: 'integer',
max: 200,
min: 20
}),
'subnet-ids': Flags.string({
description:
'Comma-separated list of AWS VPC subnet IDs to launch Fargate tasks in'
Expand Down
11 changes: 11 additions & 0 deletions packages/artillery/lib/platform/aws-ecs/legacy/run-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,17 @@ async function generateTaskOverrides(context) {
overrides.taskRoleArn = context.customRoleArn;
}

if (context.cliOptions.containerDnsServers) {
overrides.containerOverrides[0].dnsServers =
context.cliOptions.containerDnsServers.split(',');
}

if (context.cliOptions.taskEphemeralStorage) {
overrides.ephemeralStorage = {
sizeInGiB: context.cliOptions.taskEphemeralStorage
};
}

overrides.containerOverrides[0].environment.push({
name: 'USE_V2',
value: 'true'
Expand Down

0 comments on commit 7b5c3d6

Please sign in to comment.