-1

When I try to connect to the FARGATE container I have got this message error below

I tried many things, to add vpc endpoint but still the same error.

I also tried to "enable_execute_command = true # Enable execute command" in the task definition but this has no effect

 aws ecs execute-command \
  --cluster example-staging-app \
  --task 07168b-mytaskid-a86f54b362e3 \
  --container example-staging-app-Instance \
  --interactive \
  --command "/bin/bash" \                    
  --region eu-west-1 \
  --profile example-dev

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.


An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: The execute command failed because execute command was not enabled when the task was run or the execute command agent isn’t running. Wait and try again or run a new task with execute command enabled and try again.

Any idea on connection to the Fargate container? Thanks

2
  • Thanks @mark-b I found the way to enable_execute_command = true in another post How to enable excute command Commented Mar 7 at 15:38
  • used this command to enable_excecute aws ecs update-service --cluster example-staging-app\ --service example-staging-app \ --region eu-west-1 \ --enable-execute-command \ --profile example-dev Commented Mar 11 at 11:27

1 Answer 1

1

You have to set enable_execute_command = true in the task definition, and then redeploy the task. Stop the task and let the ECS service create a new one, or trigger a deployment that replaces the task.

Changes to the task definition do not take effect until after a new deployment of the task.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.