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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This action is great for executing migrations or other pre/post deployment steps
cluster: application-cluster
task-definition: application-task-def
assign-public-ip: 'DISABLED'
enable-execute-command: false

subnet-ids: |
subnet-04f133a104b9e95df
Expand Down Expand Up @@ -94,21 +95,22 @@ Will pass the following command to the container on the AWS ECS Fargate task:
<!-- action-docs-inputs -->
## Inputs

| parameter | description | required | default |
| --- | --- | --- | --- |
| task-definition | The name or the ARN of the task definition to use for the task. | `true` | |
| subnet-ids | The list of subnet IDs for the task to use. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
| security-group-ids | List of security group IDs for the task. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
| assign-public-ip | Assign public a IP to the task. Options: `['ENABLED', 'DISABLED']` | `false` | DISABLED |
| cluster | Which ECS cluster to start the task in. | `false` | |
| override-container | Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command` must also be set. | `false` | |
| override-container-command | The command to run on the container if `override-container` is passed. | `false` | |
| override-container-environment | Add or override existing environment variables if `override-container` is passed. Provide one per line in key=value format. | `false` | |
| tail-logs | If set to true, will try to extract the logConfiguration for the first container in the task definition. If `override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only possible if the provided container uses the `awslogs` logDriver. | `false` | true |
| task-wait-until-stopped | Whether to wait for the task to stop before finishing the action. If set to false, the action will finish immediately after the task reaches the `RUNNING` state (fire and forget). | `false` | true |
| task-start-max-wait-time | How long to wait for the task to start (i.e. reach the `RUNNING` state) in seconds. If the task does not start within this time, the pipeline will fail. | `false` | 120 |
| task-stop-max-wait-time | How long to wait for the task to stop (i.e. reach the `STOPPED` state) in seconds. The task will not be canceled after this time, the pipeline will just be marked as failed. | `false` | 300 |
| task-check-state-delay | How long to wait between each AWS API call to check the current state of the task in seconds. This is useful to avoid running into AWS rate limits. **However**, setting this too high might cause the Action to miss the time-window your task is in the "RUNNING" state (if you task is very short lived) and can cause the action to fail. | `false` | 6 |
| parameter | description | required | default |
|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| task-definition | The name or the ARN of the task definition to use for the task. | `true` | |
| subnet-ids | The list of subnet IDs for the task to use. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
| security-group-ids | List of security group IDs for the task. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
| assign-public-ip | Assign public a IP to the task. Options: `['ENABLED', 'DISABLED']` | `false` | DISABLED |
| cluster | Which ECS cluster to start the task in. | `false` | |
| enable-execute-command | Whether to enable the execute command feature for the task. This requires that the ECS cluster has execute command enabled and that the task role has the necessary permissions. | `false` | false |
| override-container | Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command` must also be set. | `false` | |
| override-container-command | The command to run on the container if `override-container` is passed. | `false` | |
| override-container-environment | Add or override existing environment variables if `override-container` is passed. Provide one per line in key=value format. | `false` | |
| tail-logs | If set to true, will try to extract the logConfiguration for the first container in the task definition. If `override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only possible if the provided container uses the `awslogs` logDriver. | `false` | true |
| task-wait-until-stopped | Whether to wait for the task to stop before finishing the action. If set to false, the action will finish immediately after the task reaches the `RUNNING` state (fire and forget). | `false` | true |
| task-start-max-wait-time | How long to wait for the task to start (i.e. reach the `RUNNING` state) in seconds. If the task does not start within this time, the pipeline will fail. | `false` | 120 |
| task-stop-max-wait-time | How long to wait for the task to stop (i.e. reach the `STOPPED` state) in seconds. The task will not be canceled after this time, the pipeline will just be marked as failed. | `false` | 300 |
| task-check-state-delay | How long to wait between each AWS API call to check the current state of the task in seconds. This is useful to avoid running into AWS rate limits. **However**, setting this too high might cause the Action to miss the time-window your task is in the "RUNNING" state (if you task is very short lived) and can cause the action to fail. | `false` | 6 |
<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ inputs:
Which ECS cluster to start the task in.
required: false

enable-execute-command:
description: >-
Whether to enable the execute command feature for the task. This requires
that the ECS cluster has execute command enabled and that the task role
has the necessary permissions.
required: false
default: 'false'

override-container:
description: >-
Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command`
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56487,6 +56487,7 @@ const main = async () => {
const securityGroups = core.getMultilineInput('security-group-ids', {required: true});

// Inputs: Optional
const enableExecuteCommand = core.getBooleanInput('enable-execute-command', {required: false});
const tailLogs = core.getBooleanInput('tail-logs', {required: false});
const assignPublicIp = core.getInput('assign-public-ip', {required: false});
const overrideContainer = core.getInput('override-container', {required: false});
Expand All @@ -56505,6 +56506,7 @@ const main = async () => {
cluster,
taskDefinition,
launchType: 'FARGATE',
enableExecuteCommand: enableExecuteCommand,
networkConfiguration: {
awsvpcConfiguration: {
subnets,
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const main = async () => {
const securityGroups = core.getMultilineInput('security-group-ids', {required: true});

// Inputs: Optional
const enableExecuteCommand = core.getBooleanInput('enable-execute-command', {required: false});
const tailLogs = core.getBooleanInput('tail-logs', {required: false});
const assignPublicIp = core.getInput('assign-public-ip', {required: false});
const overrideContainer = core.getInput('override-container', {required: false});
Expand All @@ -41,6 +42,7 @@ const main = async () => {
cluster,
taskDefinition,
launchType: 'FARGATE',
enableExecuteCommand: enableExecuteCommand,
networkConfiguration: {
awsvpcConfiguration: {
subnets,
Expand Down