amazonka-ecs-2.0: Amazon EC2 Container Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.ECS.ExecuteCommand

Description

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.

Synopsis

Creating a Request

data ExecuteCommand Source #

See: newExecuteCommand smart constructor.

Constructors

ExecuteCommand' 

Fields

  • cluster :: Maybe Text

    The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.

  • container :: Maybe Text

    The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.

  • command :: Text

    The command to run on the container.

  • interactive :: Bool

    Use this flag to run your command in interactive mode.

  • task :: Text

    The Amazon Resource Name (ARN) or ID of the task the container is part of.

Instances

Instances details
ToJSON ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

ToHeaders ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

ToPath ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

ToQuery ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

AWSRequest ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Associated Types

type AWSResponse ExecuteCommand #

Generic ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Associated Types

type Rep ExecuteCommand :: Type -> Type #

Read ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Show ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

NFData ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Methods

rnf :: ExecuteCommand -> () #

Eq ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Hashable ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

type AWSResponse ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

type Rep ExecuteCommand Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

type Rep ExecuteCommand = D1 ('MetaData "ExecuteCommand" "Amazonka.ECS.ExecuteCommand" "amazonka-ecs-2.0-3xFxVqi9x5nBZ44jBEC5G8" 'False) (C1 ('MetaCons "ExecuteCommand'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cluster") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "container") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "command") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "interactive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "task") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newExecuteCommand Source #

Create a value of ExecuteCommand with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:cluster:ExecuteCommand', executeCommand_cluster - The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.

$sel:container:ExecuteCommand', executeCommand_container - The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.

ExecuteCommand, executeCommand_command - The command to run on the container.

ExecuteCommand, executeCommand_interactive - Use this flag to run your command in interactive mode.

$sel:task:ExecuteCommand', executeCommand_task - The Amazon Resource Name (ARN) or ID of the task the container is part of.

Request Lenses

executeCommand_cluster :: Lens' ExecuteCommand (Maybe Text) Source #

The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.

executeCommand_container :: Lens' ExecuteCommand (Maybe Text) Source #

The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.

executeCommand_command :: Lens' ExecuteCommand Text Source #

The command to run on the container.

executeCommand_interactive :: Lens' ExecuteCommand Bool Source #

Use this flag to run your command in interactive mode.

executeCommand_task :: Lens' ExecuteCommand Text Source #

The Amazon Resource Name (ARN) or ID of the task the container is part of.

Destructuring the Response

data ExecuteCommandResponse Source #

See: newExecuteCommandResponse smart constructor.

Constructors

ExecuteCommandResponse' 

Fields

Instances

Instances details
Generic ExecuteCommandResponse Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Associated Types

type Rep ExecuteCommandResponse :: Type -> Type #

Show ExecuteCommandResponse Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

NFData ExecuteCommandResponse Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

Methods

rnf :: ExecuteCommandResponse -> () #

Eq ExecuteCommandResponse Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

type Rep ExecuteCommandResponse Source # 
Instance details

Defined in Amazonka.ECS.ExecuteCommand

newExecuteCommandResponse Source #

Create a value of ExecuteCommandResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

ExecuteCommandResponse, executeCommandResponse_clusterArn - The Amazon Resource Name (ARN) of the cluster.

ExecuteCommandResponse, executeCommandResponse_containerArn - The Amazon Resource Name (ARN) of the container.

ExecuteCommandResponse, executeCommandResponse_containerName - The name of the container.

ExecuteCommand, executeCommandResponse_interactive - Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify true for this value.

$sel:session:ExecuteCommandResponse', executeCommandResponse_session - The details of the SSM session that was created for this instance of execute-command.

ExecuteCommandResponse, executeCommandResponse_taskArn - The Amazon Resource Name (ARN) of the task.

$sel:httpStatus:ExecuteCommandResponse', executeCommandResponse_httpStatus - The response's http status code.

Response Lenses

executeCommandResponse_clusterArn :: Lens' ExecuteCommandResponse (Maybe Text) Source #

The Amazon Resource Name (ARN) of the cluster.

executeCommandResponse_containerArn :: Lens' ExecuteCommandResponse (Maybe Text) Source #

The Amazon Resource Name (ARN) of the container.

executeCommandResponse_interactive :: Lens' ExecuteCommandResponse (Maybe Bool) Source #

Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify true for this value.

executeCommandResponse_session :: Lens' ExecuteCommandResponse (Maybe Session) Source #

The details of the SSM session that was created for this instance of execute-command.

executeCommandResponse_taskArn :: Lens' ExecuteCommandResponse (Maybe Text) Source #

The Amazon Resource Name (ARN) of the task.