Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ inputs:
task-definition-revision:
description: 'The revision of the task definition being used'
required: false
cpu:
description: 'The number of CPU units used by the task'
required: false
memory:
description: 'The amount of memory (in MiB) used by the task'
required: false
container-name:
description: 'The name of the container defined in the containerDefinitions section of the ECS task definition'
required: true
Expand Down
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ async function run() {
const imageURI = core.getInput('image', { required: true });
const environmentVariables = core.getInput('environment-variables', { required: false });
const envFiles = core.getInput('env-files', { required: false });

const cpu = core.getInput('cpu', { required: false });
const memory = core.getInput('memory', { required: false });
const logConfigurationLogDriver = core.getInput("log-configuration-log-driver", { required: false });
const logConfigurationOptions = core.getInput("log-configuration-options", { required: false });
const dockerLabels = core.getInput('docker-labels', { required: false });
Expand Down Expand Up @@ -97,6 +98,14 @@ async function run() {
throw new Error("Either task definition, task definition arn or task definition family must be provided");
}

if (cpu) {
taskDefContents.cpu = cpu;
}

if (memory) {
taskDefContents.memory = memory;
}

// Insert the image URI
if (!Array.isArray(taskDefContents.containerDefinitions)) {
throw new Error('Invalid task definition format: containerDefinitions section is not present or is not an array');
Expand Down
Loading