Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Runs commands on one or more managed instances.
Synopsis
- data SendCommand = SendCommand' {
- serviceRoleArn :: Maybe Text
- notificationConfig :: Maybe NotificationConfig
- documentHashType :: Maybe DocumentHashType
- cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
- outputS3KeyPrefix :: Maybe Text
- maxErrors :: Maybe Text
- instanceIds :: Maybe [Text]
- outputS3Region :: Maybe Text
- targets :: Maybe [Target]
- parameters :: Maybe (HashMap Text [Text])
- documentHash :: Maybe Text
- documentVersion :: Maybe Text
- timeoutSeconds :: Maybe Natural
- comment :: Maybe Text
- outputS3BucketName :: Maybe Text
- maxConcurrency :: Maybe Text
- documentName :: Text
- newSendCommand :: Text -> SendCommand
- sendCommand_serviceRoleArn :: Lens' SendCommand (Maybe Text)
- sendCommand_notificationConfig :: Lens' SendCommand (Maybe NotificationConfig)
- sendCommand_documentHashType :: Lens' SendCommand (Maybe DocumentHashType)
- sendCommand_cloudWatchOutputConfig :: Lens' SendCommand (Maybe CloudWatchOutputConfig)
- sendCommand_outputS3KeyPrefix :: Lens' SendCommand (Maybe Text)
- sendCommand_maxErrors :: Lens' SendCommand (Maybe Text)
- sendCommand_instanceIds :: Lens' SendCommand (Maybe [Text])
- sendCommand_outputS3Region :: Lens' SendCommand (Maybe Text)
- sendCommand_targets :: Lens' SendCommand (Maybe [Target])
- sendCommand_parameters :: Lens' SendCommand (Maybe (HashMap Text [Text]))
- sendCommand_documentHash :: Lens' SendCommand (Maybe Text)
- sendCommand_documentVersion :: Lens' SendCommand (Maybe Text)
- sendCommand_timeoutSeconds :: Lens' SendCommand (Maybe Natural)
- sendCommand_comment :: Lens' SendCommand (Maybe Text)
- sendCommand_outputS3BucketName :: Lens' SendCommand (Maybe Text)
- sendCommand_maxConcurrency :: Lens' SendCommand (Maybe Text)
- sendCommand_documentName :: Lens' SendCommand Text
- data SendCommandResponse = SendCommandResponse' {
- command :: Maybe Command
- httpStatus :: Int
- newSendCommandResponse :: Int -> SendCommandResponse
- sendCommandResponse_command :: Lens' SendCommandResponse (Maybe Command)
- sendCommandResponse_httpStatus :: Lens' SendCommandResponse Int
Creating a Request
data SendCommand Source #
See: newSendCommand
smart constructor.
SendCommand' | |
|
Instances
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.
SendCommandResponse' | |
|
Instances
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.
sendCommandResponse_httpStatus :: Lens' SendCommandResponse Int Source #
The response's http status code.