executeCommand
Runs a command remotely on a container within a task.
If you use a condition key in your IAM policy to refine the conditions for the policy statement, for example limit the actions to a specific cluster, you receive an AccessDeniedException
when there is a mismatch between the condition key value and the corresponding parameter value.
For information about required permissions and considerations, see Using Amazon ECS Exec for debugging in the Amazon ECS Developer Guide.
Samples
fun main() {
//sampleStart
// This example runs an interactive bin sh command on a container MyContainer.
val resp = ecsClient.executeCommand {
cluster = "MyCluster"
container = "MyContainer"
command = "/bin/sh"
interactive = true
task = "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/d789e94343414c25b9f6bd59eEXAMPLE"
}
//sampleEnd
}