libZSservicesZSamazonka-ssmZSamazonka-ssm
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.SSM.SendCommand

Description

Runs commands on one or more managed instances.

Synopsis

Creating a Request

data SendCommand Source #

See: newSendCommand smart constructor.

Constructors

SendCommand' 

Fields

  • 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.

  • notificationConfig :: Maybe NotificationConfig

    Configurations for sending notifications.

  • documentHashType :: Maybe DocumentHashType

    Sha256 or Sha1.

    Sha1 hashes have been deprecated.

  • 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.

  • outputS3KeyPrefix :: Maybe Text

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

  • 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.

  • instanceIds :: Maybe [Text]

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

    To target a larger number of instances, or if you prefer not to list individual instance IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the instances to send commands to, you can a send command to tens, hundreds, or thousands of instances 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.

  • 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.

  • targets :: Maybe [Target]

    An array of search criteria that targets instances 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 instances at once. Using Targets, which accepts tag key-value pairs to identify instances, you can send a command to tens, hundreds, or thousands of instances at once.

    To send a command to a smaller number of instances, 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.

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

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

  • documentHash :: Maybe Text

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

    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"
  • timeoutSeconds :: Maybe Natural

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

  • comment :: Maybe Text

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

  • outputS3BucketName :: Maybe Text

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

  • maxConcurrency :: Maybe Text

    (Optional) The maximum number of instances 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.

  • 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
Eq SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Read SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Show SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Generic SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type Rep SendCommand :: Type -> Type #

NFData SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Methods

rnf :: SendCommand -> () #

Hashable SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

ToJSON SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

AWSRequest SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type AWSResponse 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

type Rep SendCommand Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

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

Defined in Amazonka.SSM.SendCommand

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:

$sel:serviceRoleArn: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.

$sel:notificationConfig:SendCommand', sendCommand_notificationConfig - Configurations for sending notifications.

$sel:documentHashType:SendCommand', sendCommand_documentHashType - Sha256 or Sha1.

Sha1 hashes have been deprecated.

$sel:cloudWatchOutputConfig: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.

$sel:outputS3KeyPrefix:SendCommand', sendCommand_outputS3KeyPrefix - The directory structure within the S3 bucket where the responses should be stored.

$sel:maxErrors: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.

$sel:instanceIds:SendCommand', sendCommand_instanceIds - The IDs of the instances where the command should run. Specifying instance IDs is most useful when you are targeting a limited number of instances, though you can specify up to 50 IDs.

To target a larger number of instances, or if you prefer not to list individual instance IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the instances to send commands to, you can a send command to tens, hundreds, or thousands of instances 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.

$sel:outputS3Region: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.

$sel:targets:SendCommand', sendCommand_targets - An array of search criteria that targets instances 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 instances at once. Using Targets, which accepts tag key-value pairs to identify instances, you can send a command to tens, hundreds, or thousands of instances at once.

To send a command to a smaller number of instances, 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.

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

$sel:documentHash:SendCommand', sendCommand_documentHash - The Sha256 or Sha1 hash created by the system when the document was created.

Sha1 hashes have been deprecated.

$sel:documentVersion: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"

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

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

$sel:outputS3BucketName:SendCommand', sendCommand_outputS3BucketName - The name of the S3 bucket where command execution responses should be stored.

$sel:maxConcurrency:SendCommand', sendCommand_maxConcurrency - (Optional) The maximum number of instances 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.

$sel:documentName: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_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.

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

Configurations for sending notifications.

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

Sha256 or Sha1.

Sha1 hashes have been deprecated.

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_outputS3KeyPrefix :: Lens' SendCommand (Maybe Text) Source #

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

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_instanceIds :: Lens' SendCommand (Maybe [Text]) Source #

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

To target a larger number of instances, or if you prefer not to list individual instance IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the instances to send commands to, you can a send command to tens, hundreds, or thousands of instances 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_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_targets :: Lens' SendCommand (Maybe [Target]) Source #

An array of search criteria that targets instances 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 instances at once. Using Targets, which accepts tag key-value pairs to identify instances, you can send a command to tens, hundreds, or thousands of instances at once.

To send a command to a smaller number of instances, 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_parameters :: Lens' SendCommand (Maybe (HashMap Text [Text])) Source #

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

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_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_timeoutSeconds :: Lens' SendCommand (Maybe Natural) Source #

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

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_outputS3BucketName :: Lens' SendCommand (Maybe Text) Source #

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

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

(Optional) The maximum number of instances 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_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
Eq SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Read SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Show SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Generic SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Associated Types

type Rep SendCommandResponse :: Type -> Type #

NFData SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

Methods

rnf :: SendCommandResponse -> () #

type Rep SendCommandResponse Source # 
Instance details

Defined in Amazonka.SSM.SendCommand

type Rep SendCommandResponse = D1 ('MetaData "SendCommandResponse" "Amazonka.SSM.SendCommand" "libZSservicesZSamazonka-ssmZSamazonka-ssm" '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.