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
  • Loading branch information
hassy authored Aug 6, 2024
1 parent e1fa2a7 commit 5f5adff
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 5f5adff

Please sign in to comment.