Skip to content

Commit de84787

Browse files
committed
Cleanup docs
1 parent d454721 commit de84787

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

README.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ Registers an Amazon ECS task definition and deploys it to an ECS service.
2020

2121
## Usage
2222

23-
The action supports the following inputs:
24-
25-
* `task-definition` (required) - The path to the ECS task definition file (JSON format) to register.
26-
* `max-retries` (optional) - The maximum number of retry attempts for AWS API calls. The action uses exponential backoff with jitter for retries. Defaults to 3.
27-
* `service` (optional) - The name of the ECS service to update with the new task definition. If empty, the action will not attempt to update a service.
28-
2923
```yaml
3024
- name: Deploy to Amazon ECS
3125
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
@@ -234,7 +228,7 @@ Running a service requires the following minimum set of permissions:
234228
]
235229
}
236230
```
237-
231+
238232
Running a one-off/stand-alone task requires the following minimum set of permissions:
239233
```json
240234
{
@@ -348,7 +342,7 @@ In the following example, the service would not be updated until the ad-hoc task
348342
wait-for-task-stopped: true
349343
```
350344

351-
Overrides and VPC networking options are available as well. See [action.yml](action.yml) for more details. The `FARGATE`
345+
Overrides and VPC networking options are available as well. See [action.yml](action.yml) for more details. The `FARGATE`
352346
launch type requires `awsvpc` network mode in your task definition and you must specify a network configuration.
353347

354348
### Tags
@@ -375,21 +369,44 @@ To tag your tasks:
375369

376370
## Preserving Empty Values with keep-null-value-keys
377371

378-
By default, this action removes empty string, array, and object values from the ECS task definition before registering it. If you want to preserve empty values for specific keys, use the `keep-null-value-keys` input. This is a comma-separated list of key names. When specified, any empty value for those keys will be kept in the registered task definition.
372+
By default, this action removes empty string, array, and object values from the ECS task definition before registering it. This behavior aligns with ECS defaults but can be problematic when you explicitly want to override a non-null default value with an empty or null value.
373+
374+
To preserve empty values for specific keys, use the keep-null-value-keys input. This is a comma-separated list of key names. When specified, empty values for those keys will be retained in the registered task definition.
375+
376+
This is particularly useful in cases where ECS or a previous task definition applies a default value and you want to explicitly unset it.
379377

380378
**Example:**
381379

382-
```yaml
383-
- name: Deploy to Amazon ECS
384-
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
385-
with:
386-
task-definition: task-definition.json
387-
service: my-service
388-
cluster: my-cluster
389-
keep-null-value-keys: tag,command,placementConstraints
380+
```
381+
- name: Deploy to Amazon ECS
382+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
383+
with:
384+
task-definition: task-definition.json
385+
service: my-service
386+
cluster: my-cluster
387+
keep-null-value-keys: tag,command,placementConstraints
388+
wait-for-service-stability: true
389+
```
390+
391+
## Retries
392+
393+
To automatically retry a failed task definition deployment, use the max-retries input. This controls how many times the action will attempt to register and deploy the task definition before failing.
394+
395+
- Default: 3
396+
- Minimum: 0 (no retries)
397+
398+
```
399+
- name: Deploy to Amazon ECS
400+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
401+
with:
402+
task-definition: task-definition.json
403+
service: my-service
404+
cluster: my-cluster
405+
max-retries: 5
406+
wait-for-service-stability: true
390407
```
391408
392-
This is useful for cases where a default value is non-null and you want to override the value and set it to null.
409+
Retries apply to transient failures during task definition registration or service update, such as eventual consistency issues or temporary AWS API errors.
393410
394411
## Troubleshooting
395412

0 commit comments

Comments
 (0)