Skip to content

Commit d0de793

Browse files
committed
fixed the enableFaultInjection error.
The Issue: The describe-task-definition command returns some internal AWS fields (like enableFaultInjection) that are not allowed when you try to register a new version of the task definition. The Fix: I updated the workflow to use jq to remove these "read-only" fields (enableFaultInjection, status, taskDefinitionArn, etc.) from the task-definition.json file before using it.
1 parent 13f1d96 commit d0de793

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
- name: Download Task Definition
7272
run: |
7373
aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_DEFINITION }} --query taskDefinition > task-definition.json
74+
echo $(cat task-definition.json | jq 'del(.taskDefinitionArn, .revision, .status, .requiresAttributes, .compatibilities, .registeredAt, .registeredBy, .enableFaultInjection)') > task-definition.json
7475
7576
- name: Fill in the new image ID in the Amazon ECS task definition
7677
id: task-def

0 commit comments

Comments
 (0)