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 e1fa2a7 commit 40cfdd4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 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,16 @@ 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. Fargate-only.',
type: 'integer',
}),

'subnet-ids': Flags.string({
description:
'Comma-separated list of AWS VPC subnet IDs to launch Fargate tasks in'
Expand Down
10 changes: 10 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 @@ -1203,6 +1203,10 @@ async function ensureTaskExists(context) {
}
};

if (context.cliOptions.containerDnsServers) {
artilleryContainerDefinition.dnsServers = context.cliOptions.containerDnsServers.split(',');
}

let taskDefinition = {
family: context.taskName,
containerDefinitions: [artilleryContainerDefinition],
Expand Down Expand Up @@ -1495,6 +1499,12 @@ async function generateTaskOverrides(context) {
overrides.taskRoleArn = context.customRoleArn;
}

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 40cfdd4

Please sign in to comment.