Skip to content

Commit 9e80eba

Browse files
committed
"Can I ExecuteCommand" should check on task resource not cluster
1 parent 27ac726 commit 9e80eba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

check-ecs-exec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ ecsExecuteCommand="ecs:ExecuteCommand"
235235
ecsExecEvalResult=$(${AWS_CLI_BIN} iam simulate-principal-policy \
236236
--policy-source-arn "${MY_IAM_ARN}" \
237237
--action-names "${ecsExecuteCommand}" \
238-
--resource-arns "arn:aws:ecs:${AWS_REGION}:${ACCOUNT_ID}:cluster/${CLUSTER_NAME}" \
238+
--resource-arns "arn:aws:ecs:${AWS_REGION}:${ACCOUNT_ID}:task/${CLUSTER_NAME}/${TASK_ID}" \
239239
--output json \
240240
| jq -r ".EvaluationResults[0].EvalDecision")
241241
showEvalResult "${ecsExecEvalResult}" "${ecsExecuteCommand}"

0 commit comments

Comments
 (0)