amazonka-ssm-2.0: Amazon Simple Systems Manager (SSM) 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.SSM.SendCommand

Description

Runs commands on one or more managed nodes.

Synopsis

Creating a Request

data SendCommand Source #

See: newSendCommand smart constructor.

Constructors

SendCommand' 

Fields

  • alarmConfiguration :: Maybe AlarmConfiguration

    The CloudWatch alarm you want to apply to your command.

  • cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig

    Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.

  • comment :: Maybe Text

    User-specified information about the command, such as a brief description of what the command should do.

  • documentHash :: Maybe Text

    The Sha256 or Sha1 hash created by the system when the document was created.

    Sha1 hashes have been deprecated.

  • documentHashType :: Maybe DocumentHashType

    Sha256 or Sha1.

    Sha1 hashes have been deprecated.

  • documentVersion :: Maybe Text

    The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

    • -document-version "\$DEFAULT"
    • -document-version "\$LATEST"
    • -document-version "3"
  • instanceIds :: Maybe [Text]

    The IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

    To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

    For more information about how to use targets, see Using targets and rate controls to send commands to a fleet in the Amazon Web Services Systems Manager User Guide.

  • maxConcurrency :: Maybe Text

    (Optional) The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number such as 10 or a percentage such as 10%. The default value is 50. For more information about how to use MaxConcurrency, see Using concurrency controls in the Amazon Web Services Systems Manager User Guide.

  • maxErrors :: Maybe Text

    The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide.

  • notificationConfig :: Maybe NotificationConfig

    Configurations for sending notifications.

  • outputS3BucketName :: Maybe Text

    The name of the S3 bucket where command execution responses should be stored.

  • outputS3KeyPrefix :: Maybe Text

    The directory structure within the S3 bucket where the responses should be stored.

  • outputS3Region :: Maybe Text

    (Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

  • parameters :: Maybe (Sensitive (HashMap Text [Text]))

    The required and optional parameters specified in the document being run.

  • serviceRoleArn :: Maybe Text

    The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

    This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

  • targets :: Maybe [Target]

    An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

    To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

    For more information about how to use targets, see Sending commands to a fleet in the Amazon Web Services Systems Manager User Guide.

  • timeoutSeconds :: Maybe Natural

    If this time is reached and the command hasn't already started running, it won't run.

  • documentName :: Text

    The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Using shared SSM documents in the Amazon Web Services Systems Manager User Guide.

    If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

Instances

Instances details
ToJSON SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

ToHeaders SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Methods

toHeaders :: SendCommand -> [Header] #

ToPath SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

ToQuery SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

AWSRequest SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type AWSResponse SendCommand #

Generic SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type Rep SendCommand :: Type -> Type #

Show SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

NFData SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Methods

rnf :: SendCommand -> () #

Eq SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Hashable SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type AWSResponse SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type Rep SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type Rep SendCommand = D1 ('MetaData "SendCommand" "Amazonka.SSM.SendCommand" "amazonka-ssm-2.0-Ak65QSGRhJDC5x7UvsCpi8" 'False) (C1 ('MetaCons "SendCommand'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "alarmConfiguration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AlarmConfiguration)) :*: S1 ('MetaSel ('Just "cloudWatchOutputConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe CloudWatchOutputConfig))) :*: (S1 ('MetaSel ('Just "comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "documentHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "documentHashType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DocumentHashType)) :*: S1 ('MetaSel ('Just "documentVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "instanceIds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "maxConcurrency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "maxErrors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))))) :*: (((S1 ('MetaSel ('Just "notificationConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe NotificationConfig)) :*: S1 ('MetaSel ('Just "outputS3BucketName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "outputS3KeyPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "outputS3Region") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive (HashMap Text [Text])))) :*: S1 ('MetaSel ('Just "serviceRoleArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "targets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Target])) :*: (S1 ('MetaSel ('Just "timeoutSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "documentName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))))

newSendCommand Source #

Create a value of SendCommand 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:

SendCommand, sendCommand_alarmConfiguration - The CloudWatch alarm you want to apply to your command.

SendCommand, sendCommand_cloudWatchOutputConfig - Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.

SendCommand, sendCommand_comment - User-specified information about the command, such as a brief description of what the command should do.

SendCommand, sendCommand_documentHash - The Sha256 or Sha1 hash created by the system when the document was created.

Sha1 hashes have been deprecated.

SendCommand, sendCommand_documentHashType - Sha256 or Sha1.

Sha1 hashes have been deprecated.

SendCommand, sendCommand_documentVersion - The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

  • -document-version "\$DEFAULT"
  • -document-version "\$LATEST"
  • -document-version "3"

SendCommand, sendCommand_instanceIds - The IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

For more information about how to use targets, see Using targets and rate controls to send commands to a fleet in the Amazon Web Services Systems Manager User Guide.

SendCommand, sendCommand_maxConcurrency - (Optional) The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number such as 10 or a percentage such as 10%. The default value is 50. For more information about how to use MaxConcurrency, see Using concurrency controls in the Amazon Web Services Systems Manager User Guide.

SendCommand, sendCommand_maxErrors - The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide.

SendCommand, sendCommand_notificationConfig - Configurations for sending notifications.

SendCommand, sendCommand_outputS3BucketName - The name of the S3 bucket where command execution responses should be stored.

SendCommand, sendCommand_outputS3KeyPrefix - The directory structure within the S3 bucket where the responses should be stored.

SendCommand, sendCommand_outputS3Region - (Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

SendCommand, sendCommand_parameters - The required and optional parameters specified in the document being run.

SendCommand, sendCommand_serviceRoleArn - The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

SendCommand, sendCommand_targets - An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

For more information about how to use targets, see Sending commands to a fleet in the Amazon Web Services Systems Manager User Guide.

SendCommand, sendCommand_timeoutSeconds - If this time is reached and the command hasn't already started running, it won't run.

SendCommand, sendCommand_documentName - The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Using shared SSM documents in the Amazon Web Services Systems Manager User Guide.

If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

Request Lenses

sendCommand_alarmConfiguration :: Lens' SendCommand (Maybe AlarmConfiguration) Source #

The CloudWatch alarm you want to apply to your command.

sendCommand_cloudWatchOutputConfig :: Lens' SendCommand (Maybe CloudWatchOutputConfig) Source #

Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.

sendCommand_comment :: Lens' SendCommand (Maybe Text) Source #

User-specified information about the command, such as a brief description of what the command should do.

sendCommand_documentHash :: Lens' SendCommand (Maybe Text) Source #

The Sha256 or Sha1 hash created by the system when the document was created.

Sha1 hashes have been deprecated.

sendCommand_documentHashType :: Lens' SendCommand (Maybe DocumentHashType) Source #

Sha256 or Sha1.

Sha1 hashes have been deprecated.

sendCommand_documentVersion :: Lens' SendCommand (Maybe Text) Source #

The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

  • -document-version "\$DEFAULT"
  • -document-version "\$LATEST"
  • -document-version "3"

sendCommand_instanceIds :: Lens' SendCommand (Maybe [Text]) Source #

The IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

For more information about how to use targets, see Using targets and rate controls to send commands to a fleet in the Amazon Web Services Systems Manager User Guide.

sendCommand_maxConcurrency :: Lens' SendCommand (Maybe Text) Source #

(Optional) The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number such as 10 or a percentage such as 10%. The default value is 50. For more information about how to use MaxConcurrency, see Using concurrency controls in the Amazon Web Services Systems Manager User Guide.

sendCommand_maxErrors :: Lens' SendCommand (Maybe Text) Source #

The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide.

sendCommand_notificationConfig :: Lens' SendCommand (Maybe NotificationConfig) Source #

Configurations for sending notifications.

sendCommand_outputS3BucketName :: Lens' SendCommand (Maybe Text) Source #

The name of the S3 bucket where command execution responses should be stored.

sendCommand_outputS3KeyPrefix :: Lens' SendCommand (Maybe Text) Source #

The directory structure within the S3 bucket where the responses should be stored.

sendCommand_outputS3Region :: Lens' SendCommand (Maybe Text) Source #

(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

sendCommand_parameters :: Lens' SendCommand (Maybe (HashMap Text [Text])) Source #

The required and optional parameters specified in the document being run.

sendCommand_serviceRoleArn :: Lens' SendCommand (Maybe Text) Source #

The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide.

sendCommand_targets :: Lens' SendCommand (Maybe [Target]) Source #

An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

For more information about how to use targets, see Sending commands to a fleet in the Amazon Web Services Systems Manager User Guide.

sendCommand_timeoutSeconds :: Lens' SendCommand (Maybe Natural) Source #

If this time is reached and the command hasn't already started running, it won't run.

sendCommand_documentName :: Lens' SendCommand Text Source #

The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Using shared SSM documents in the Amazon Web Services Systems Manager User Guide.

If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

Destructuring the Response

data SendCommandResponse Source #

See: newSendCommandResponse smart constructor.

Constructors

SendCommandResponse' 

Fields

  • command :: Maybe Command

    The request as it was received by Systems Manager. Also provides the command ID which can be used future references to this request.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type Rep SendCommandResponse :: Type -> Type #

Show SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

NFData SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Methods

rnf :: SendCommandResponse -> () #

Eq SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type Rep SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type Rep SendCommandResponse = D1 ('MetaData "SendCommandResponse" "Amazonka.SSM.SendCommand" "amazonka-ssm-2.0-Ak65QSGRhJDC5x7UvsCpi8" 'False) (C1 ('MetaCons "SendCommandResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "command") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Command)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newSendCommandResponse Source #

Create a value of SendCommandResponse 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:command:SendCommandResponse', sendCommandResponse_command - The request as it was received by Systems Manager. Also provides the command ID which can be used future references to this request.

$sel:httpStatus:SendCommandResponse', sendCommandResponse_httpStatus - The response's http status code.

Response Lenses

sendCommandResponse_command :: Lens' SendCommandResponse (Maybe Command) Source #

The request as it was received by Systems Manager. Also provides the command ID which can be used future references to this request.