2020/12/15 - Amazon Simple Systems Manager (SSM) - 4 new 19 updated api methods
Changes Adding support for Change Manager API content
Updates information related to approval reviews for a specific version of a document.
See also: AWS API Documentation
Request Syntax
client.update_document_metadata( Name='string', DocumentVersion='string', DocumentReviews={ 'Action': 'SendForReview'|'UpdateReview'|'Approve'|'Reject', 'Comment': [ { 'Type': 'Comment', 'Content': 'string' }, ] } )
string
[REQUIRED]
The name of the document for which a version is to be updated.
string
The version of a document to update.
dict
[REQUIRED]
The document review details to update.
Action (string) -- [REQUIRED]
The action to take on a document approval review request.
Comment (list) --
A comment entered by a user in your organization about the document review request.
(dict) --
Information about comments added to a document review request.
Type (string) --
The type of information added to a review request. Currently, only the value Comment is supported.
Content (string) --
The content of a comment entered by a user who requests a review of a new document version, or who reviews the new version.
dict
Response Syntax
{}
Response Structure
(dict) --
Information about approval reviews for a version of an SSM document.
See also: AWS API Documentation
Request Syntax
client.list_document_metadata_history( Name='string', DocumentVersion='string', Metadata='DocumentReviews', NextToken='string', MaxResults=123 )
string
[REQUIRED]
The name of the document.
string
The version of the document.
string
[REQUIRED]
The type of data for which details are being requested. Currently, the only supported value is DocumentReviews .
string
The token for the next set of items to return. (You received this token from a previous call.)
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
dict
Response Syntax
{ 'Name': 'string', 'DocumentVersion': 'string', 'Author': 'string', 'Metadata': { 'ReviewerResponse': [ { 'CreateTime': datetime(2015, 1, 1), 'UpdatedTime': datetime(2015, 1, 1), 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED', 'Comment': [ { 'Type': 'Comment', 'Content': 'string' }, ], 'Reviewer': 'string' }, ] }, 'NextToken': 'string' }
Response Structure
(dict) --
Name (string) --
The name of the document.
DocumentVersion (string) --
The version of the document.
Author (string) --
The user ID of the person in the organization who requested the document review.
Metadata (dict) --
Information about the response to the document approval request.
ReviewerResponse (list) --
Details about a reviewer's response to a document review request.
(dict) --
Information about a reviewer's response to a document review request.
CreateTime (datetime) --
The date and time that a reviewer entered a response to a document review request.
UpdatedTime (datetime) --
The date and time that a reviewer last updated a response to a document review request.
ReviewStatus (string) --
The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.
Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.
Only one version of a document can be in review, or PENDING, at a time.
Comment (list) --
The comment entered by a reviewer as part of their document review response.
(dict) --
Information about comments added to a document review request.
Type (string) --
The type of information added to a review request. Currently, only the value Comment is supported.
Content (string) --
The content of a comment entered by a user who requests a review of a new document version, or who reviews the new version.
Reviewer (string) --
The user in your organization assigned to review a document request.
NextToken (string) --
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
Returns a list of all OpsItem events in the current AWS account and Region. You can limit the results to events associated with specific OpsItems by specifying a filter.
See also: AWS API Documentation
Request Syntax
client.list_ops_item_events( Filters=[ { 'Key': 'OpsItemId', 'Values': [ 'string', ], 'Operator': 'Equal' }, ], MaxResults=123, NextToken='string' )
list
One or more OpsItem filters. Use a filter to return a more specific list of results.
(dict) --
Describes a filter for a specific list of OpsItem events. You can filter event information by using tags. You specify tags by using a key-value pair mapping.
Key (string) -- [REQUIRED]
The name of the filter key. Currently, the only supported value is OpsItemId .
Values (list) -- [REQUIRED]
The values for the filter, consisting of one or more OpsItem IDs.
(string) --
Operator (string) -- [REQUIRED]
The operator used by the filter call. Currently, the only supported value is Equal .
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
A token to start the list. Use this token to get the next set of results.
dict
Response Syntax
{ 'NextToken': 'string', 'Summaries': [ { 'OpsItemId': 'string', 'EventId': 'string', 'Source': 'string', 'DetailType': 'string', 'Detail': 'string', 'CreatedBy': { 'Arn': 'string' }, 'CreatedTime': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) --
NextToken (string) --
The token for the next set of items to return. Use this token to get the next set of results.
Summaries (list) --
A list of event information for the specified OpsItems.
(dict) --
Summary information about an OpsItem event.
OpsItemId (string) --
The ID of the OpsItem.
EventId (string) --
The ID of the OpsItem event.
Source (string) --
The source of the OpsItem event.
DetailType (string) --
The type of information provided as a detail.
Detail (string) --
Specific information about the OpsItem event.
CreatedBy (dict) --
Information about the user or resource that created the OpsItem event.
Arn (string) --
The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem event.
CreatedTime (datetime) --
The date and time the OpsItem event was created.
Creates a change request for Change Manager. The runbooks (Automation documents) specified in the change request run only after all required approvals for the change request have been received.
See also: AWS API Documentation
Request Syntax
client.start_change_request_execution( ScheduledTime=datetime(2015, 1, 1), DocumentName='string', DocumentVersion='string', Parameters={ 'string': [ 'string', ] }, ChangeRequestName='string', ClientToken='string', Runbooks=[ { 'DocumentName': 'string', 'DocumentVersion': 'string', 'Parameters': { 'string': [ 'string', ] }, 'TargetParameterName': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ], Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
datetime
The date and time specified in the change request to run the Automation runbooks.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
string
[REQUIRED]
The name of the change template document to run during the runbook workflow.
string
The version of the change template document to run during the runbook workflow.
dict
A key-value map of parameters that match the declared parameters in the change template document.
(string) --
(list) --
(string) --
string
The name of the change request associated with the runbook workflow to be run.
string
The user-provided idempotency token. The token must be unique, is case insensitive, enforces the UUID format, and can't be reused.
list
[REQUIRED]
Information about the Automation runbooks (Automation documents) that are run during the runbook workflow.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
(dict) --
Information about an Automation runbook (Automation document) used in a runbook workflow in Change Manager.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
DocumentName (string) -- [REQUIRED]
The name of the Automation runbook (Automation document) used in a runbook workflow.
DocumentVersion (string) --
The version of the Automation runbook (Automation document) used in a runbook workflow.
Parameters (dict) --
The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .
(string) --
(list) --
(string) --
TargetParameterName (string) --
The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify Targets .
Targets (list) --
A key-value mapping to target resources that the Runbook operation performs tasks on. Required if you specify TargetParameterName .
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
MaxConcurrency (string) --
The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.
MaxErrors (string) --
The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.
TargetLocations (list) --
Information about the AWS Regions and accounts targeted by the current Runbook operation.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
list
Optional metadata that you assign to a resource. You can specify a maximum of five tags for a change request. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a change request to identify an environment or target AWS Region. In this case, you could specify the following key-value pairs:
Key=Environment,Value=Production
Key=Region,Value=us-east-2
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) -- [REQUIRED]
The name of the tag.
Value (string) -- [REQUIRED]
The value of the tag.
dict
Response Syntax
{ 'AutomationExecutionId': 'string' }
Response Structure
(dict) --
AutomationExecutionId (string) --
The unique ID of a runbook workflow operation. (A runbook workflow is a type of Automation operation.)
{'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}Response
{'AssociationDescription': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
A State Manager association defines the state that you want to maintain on your instances. For example, an association can specify that anti-virus software must be installed and running on your instances, or that certain ports must be closed. For static targets, the association specifies a schedule for when the configuration is reapplied. For dynamic targets, such as an AWS Resource Group or an AWS Autoscaling Group, State Manager applies the configuration when new instances are added to the group. The association also specifies actions to take when applying the configuration. For example, an association for anti-virus software might run once a day. If the software is not installed, then State Manager installs it. If the software is installed, but the service is not running, then the association might instruct State Manager to start the service.
See also: AWS API Documentation
Request Syntax
client.create_association( Name='string', DocumentVersion='string', InstanceId='string', Parameters={ 'string': [ 'string', ] }, Targets=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], ScheduleExpression='string', OutputLocation={ 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, AssociationName='string', AutomationTargetParameterName='string', MaxErrors='string', MaxConcurrency='string', ComplianceSeverity='CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', SyncCompliance='AUTO'|'MANUAL', ApplyOnlyAtCronInterval=True|False, TargetLocations=[ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] )
string
[REQUIRED]
The name of the SSM document that contains the configuration information for the instance. You can specify Command or Automation documents.
You can specify AWS-predefined documents, documents you created, or a document that is shared with you from another account.
For SSM documents that are shared with you from other AWS accounts, you must specify the complete SSM document ARN, in the following format:
``arn:partition :ssm:region :account-id :document/document-name ``
For example:
arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document
For AWS-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .
string
The document version you want to associate with the target(s). Can be a specific version or the default version.
string
The instance ID.
Note
InstanceId has been deprecated. To specify an instance ID for an association, use the Targets parameter. Requests that include the parameter InstanceID with SSM documents that use schema version 2.0 or later will fail. In addition, if you use the parameter InstanceId , you cannot use the parameters AssociationName , DocumentVersion , MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use these parameters, you must use the Targets parameter.
dict
The parameters for the runtime configuration of the document.
(string) --
(list) --
(string) --
list
The targets for the association. You can target instances by using tags, AWS Resource Groups, all instances in an AWS account, or individual instance IDs. For more information about choosing targets for an association, see Using targets and rate controls with State Manager associations in the AWS Systems Manager User Guide .
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
string
A cron expression when the association will be applied to the target(s).
dict
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
string
Specify a descriptive name for the association.
string
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
string
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
string
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
string
The severity level to assign to the association.
string
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
boolean
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
list
A location is a combination of AWS Regions and AWS accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
dict
Response Syntax
{ 'AssociationDescription': { 'Name': 'string', 'InstanceId': 'string', 'AssociationVersion': 'string', 'Date': datetime(2015, 1, 1), 'LastUpdateAssociationDate': datetime(2015, 1, 1), 'Status': { 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' }, 'Overview': { 'Status': 'string', 'DetailedStatus': 'string', 'AssociationStatusAggregatedCount': { 'string': 123 } }, 'DocumentVersion': 'string', 'AutomationTargetParameterName': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AssociationId': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'LastExecutionDate': datetime(2015, 1, 1), 'LastSuccessfulExecutionDate': datetime(2015, 1, 1), 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] } }
Response Structure
(dict) --
AssociationDescription (dict) --
Information about the association.
Name (string) --
The name of the Systems Manager document.
InstanceId (string) --
The ID of the instance.
AssociationVersion (string) --
The association version.
Date (datetime) --
The date when the association was made.
LastUpdateAssociationDate (datetime) --
The date when the association was last updated.
Status (dict) --
The association status.
Date (datetime) --
The date when the status changed.
Name (string) --
The status.
Message (string) --
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
Overview (dict) --
Information about the association.
Status (string) --
The status of the association. Status can be: Pending, Success, or Failed.
DetailedStatus (string) --
A detailed status of the association.
AssociationStatusAggregatedCount (dict) --
Returns the number of targets for the association status. For example, if you created an association with two instances, and one of them was successful, this would return the count of instances by status.
(string) --
(integer) --
DocumentVersion (string) --
The document version.
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AssociationId (string) --
The association ID.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
LastExecutionDate (datetime) --
The date on which the association was last run.
LastSuccessfulExecutionDate (datetime) --
The last date on which the association was successfully run.
AssociationName (string) --
The association name.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you want to run the association.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
{'Entries': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}Response
{'Failed': {'Entry': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}, 'Successful': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
Associates the specified Systems Manager document with the specified instances or targets.
When you associate a document with one or more instances using instance IDs or tags, SSM Agent running on the instance processes the document and configures the instance as specified.
If you associate a document with an instance that already has an associated document, the system returns the AssociationAlreadyExists exception.
See also: AWS API Documentation
Request Syntax
client.create_association_batch( Entries=[ { 'Name': 'string', 'InstanceId': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AutomationTargetParameterName': 'string', 'DocumentVersion': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ] )
list
[REQUIRED]
One or more associations.
(dict) --
Describes the association of a Systems Manager SSM document and an instance.
Name (string) -- [REQUIRED]
The name of the SSM document that contains the configuration information for the instance. You can specify Command or Automation documents.
You can specify AWS-predefined documents, documents you created, or a document that is shared with you from another account.
For SSM documents that are shared with you from other AWS accounts, you must specify the complete SSM document ARN, in the following format:
``arn:aws:ssm:region :account-id :document/document-name ``
For example:
arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document
For AWS-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .
InstanceId (string) --
The ID of the instance.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
DocumentVersion (string) --
The document version.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the results of this request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
AssociationName (string) --
Specify a descriptive name for the association.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level to assign to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
Use this action to create an association in multiple Regions and multiple accounts.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
dict
Response Syntax
{ 'Successful': [ { 'Name': 'string', 'InstanceId': 'string', 'AssociationVersion': 'string', 'Date': datetime(2015, 1, 1), 'LastUpdateAssociationDate': datetime(2015, 1, 1), 'Status': { 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' }, 'Overview': { 'Status': 'string', 'DetailedStatus': 'string', 'AssociationStatusAggregatedCount': { 'string': 123 } }, 'DocumentVersion': 'string', 'AutomationTargetParameterName': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AssociationId': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'LastExecutionDate': datetime(2015, 1, 1), 'LastSuccessfulExecutionDate': datetime(2015, 1, 1), 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ], 'Failed': [ { 'Entry': { 'Name': 'string', 'InstanceId': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AutomationTargetParameterName': 'string', 'DocumentVersion': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, 'Message': 'string', 'Fault': 'Client'|'Server'|'Unknown' }, ] }
Response Structure
(dict) --
Successful (list) --
Information about the associations that succeeded.
(dict) --
Describes the parameters for a document.
Name (string) --
The name of the Systems Manager document.
InstanceId (string) --
The ID of the instance.
AssociationVersion (string) --
The association version.
Date (datetime) --
The date when the association was made.
LastUpdateAssociationDate (datetime) --
The date when the association was last updated.
Status (dict) --
The association status.
Date (datetime) --
The date when the status changed.
Name (string) --
The status.
Message (string) --
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
Overview (dict) --
Information about the association.
Status (string) --
The status of the association. Status can be: Pending, Success, or Failed.
DetailedStatus (string) --
A detailed status of the association.
AssociationStatusAggregatedCount (dict) --
Returns the number of targets for the association status. For example, if you created an association with two instances, and one of them was successful, this would return the count of instances by status.
(string) --
(integer) --
DocumentVersion (string) --
The document version.
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AssociationId (string) --
The association ID.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
LastExecutionDate (datetime) --
The date on which the association was last run.
LastSuccessfulExecutionDate (datetime) --
The last date on which the association was successfully run.
AssociationName (string) --
The association name.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you want to run the association.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
Failed (list) --
Information about the associations that failed.
(dict) --
Describes a failed association.
Entry (dict) --
The association.
Name (string) --
The name of the SSM document that contains the configuration information for the instance. You can specify Command or Automation documents.
You can specify AWS-predefined documents, documents you created, or a document that is shared with you from another account.
For SSM documents that are shared with you from other AWS accounts, you must specify the complete SSM document ARN, in the following format:
``arn:aws:ssm:region :account-id :document/document-name ``
For example:
arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document
For AWS-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .
InstanceId (string) --
The ID of the instance.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
DocumentVersion (string) --
The document version.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the results of this request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
AssociationName (string) --
Specify a descriptive name for the association.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level to assign to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
Use this action to create an association in multiple Regions and multiple accounts.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
Message (string) --
A description of the failure.
Fault (string) --
The source of the failure.
{'DocumentType': {'Automation.ChangeTemplate'}}Response
{'DocumentDescription': {'ApprovedVersion': 'string', 'Author': 'string', 'DocumentType': {'Automation.ChangeTemplate'}, 'PendingReviewVersion': 'string', 'ReviewInformation': [{'ReviewedTime': 'timestamp', 'Reviewer': 'string', 'Status': 'APPROVED | ' 'NOT_REVIEWED | ' 'PENDING | ' 'REJECTED'}], 'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | ' 'REJECTED'}}
Creates a Systems Manager (SSM) document. An SSM document defines the actions that Systems Manager performs on your managed instances. For more information about SSM documents, including information about supported schemas, features, and syntax, see AWS Systems Manager Documents in the AWS Systems Manager User Guide .
See also: AWS API Documentation
Request Syntax
client.create_document( Content='string', Requires=[ { 'Name': 'string', 'Version': 'string' }, ], Attachments=[ { 'Key': 'SourceUrl'|'S3FileUrl'|'AttachmentReference', 'Values': [ 'string', ], 'Name': 'string' }, ], Name='string', VersionName='string', DocumentType='Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', DocumentFormat='YAML'|'JSON'|'TEXT', TargetType='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
[REQUIRED]
The content for the new SSM document in JSON or YAML format. We recommend storing the contents for your new document in an external JSON or YAML file and referencing the file in a command.
For examples, see the following topics in the AWS Systems Manager User Guide .
list
A list of SSM documents required by a document. This parameter is used exclusively by AWS AppConfig. When a user creates an AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document for validation purposes. For more information, see AWS AppConfig in the AWS Systems Manager User Guide .
(dict) --
An SSM document required by the current document.
Name (string) -- [REQUIRED]
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
list
A list of key and value pairs that describe attachments to a version of a document.
(dict) --
Identifying information about a document attachment, including the file name and a key-value pair that identifies the location of an attachment to a document.
Key (string) --
The key of a key-value pair that identifies the location of an attachment to a document.
Values (list) --
The value of a key-value pair that identifies the location of an attachment to a document. The format for Value depends on the type of key you specify.
For the key SourceUrl , the value is an S3 bucket location. For example: "Values": [ "s3://doc-example-bucket/my-folder" ]
For the key S3FileUrl , the value is a file in an S3 bucket. For example: "Values": [ "s3://doc-example-bucket/my-folder/my-file.py" ]
For the key AttachmentReference , the value is constructed from the name of another SSM document in your account, a version number of that document, and a file attached to that document version that you want to reuse. For example: "Values": [ "MyOtherDocument/3/my-other-file.py" ] However, if the SSM document is shared with you from another account, the full SSM document ARN must be specified instead of the document name only. For example: "Values": [ "arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py" ]
(string) --
Name (string) --
The name of the document attachment file.
string
[REQUIRED]
A name for the Systems Manager document.
Warning
You can't use the following strings as document name prefixes. These are reserved by AWS for use as document name prefixes:
aws-
amazon
amzn
string
An optional field specifying the version of the artifact you are creating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
string
The type of document to create.
string
Specify the document format for the request. The document format can be JSON, YAML, or TEXT. JSON is the default format.
string
Specify a target type to define the kinds of resources the document can run on. For example, to run a document on EC2 instances, specify the following value: /AWS::EC2::Instance. If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .
list
Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an SSM document to identify the types of targets or the environment where it will run. In this case, you could specify the following key name/value pairs:
Key=OS,Value=Windows
Key=Environment,Value=Production
Note
To add tags to an existing SSM document, use the AddTagsToResource action.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) -- [REQUIRED]
The name of the tag.
Value (string) -- [REQUIRED]
The value of the tag.
dict
Response Syntax
{ 'DocumentDescription': { 'Sha1': 'string', 'Hash': 'string', 'HashType': 'Sha256'|'Sha1', 'Name': 'string', 'VersionName': 'string', 'Owner': 'string', 'CreatedDate': datetime(2015, 1, 1), 'Status': 'Creating'|'Active'|'Updating'|'Deleting'|'Failed', 'StatusInformation': 'string', 'DocumentVersion': 'string', 'Description': 'string', 'Parameters': [ { 'Name': 'string', 'Type': 'String'|'StringList', 'Description': 'string', 'DefaultValue': 'string' }, ], 'PlatformTypes': [ 'Windows'|'Linux', ], 'DocumentType': 'Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', 'SchemaVersion': 'string', 'LatestVersion': 'string', 'DefaultVersion': 'string', 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'TargetType': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AttachmentsInformation': [ { 'Name': 'string' }, ], 'Requires': [ { 'Name': 'string', 'Version': 'string' }, ], 'Author': 'string', 'ReviewInformation': [ { 'ReviewedTime': datetime(2015, 1, 1), 'Status': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED', 'Reviewer': 'string' }, ], 'ApprovedVersion': 'string', 'PendingReviewVersion': 'string', 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED' } }
Response Structure
(dict) --
DocumentDescription (dict) --
Information about the Systems Manager document.
Sha1 (string) --
The SHA1 hash of the document, which you can use for verification.
Hash (string) --
The Sha256 or Sha1 hash created by the system when the document was created.
Note
Sha1 hashes have been deprecated.
HashType (string) --
The hash type of the document. Valid values include Sha256 or Sha1 .
Note
Sha1 hashes have been deprecated.
Name (string) --
The name of the Systems Manager document.
VersionName (string) --
The version of the artifact associated with the document.
Owner (string) --
The AWS user account that created the document.
CreatedDate (datetime) --
The date when the document was created.
Status (string) --
The status of the Systems Manager document.
StatusInformation (string) --
A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."
DocumentVersion (string) --
The document version.
Description (string) --
A description of the document.
Parameters (list) --
A description of the parameters for a document.
(dict) --
Parameters specified in a System Manager document that run on the server when the command is run.
Name (string) --
The name of the parameter.
Type (string) --
The type of parameter. The type can be either String or StringList.
Description (string) --
A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.
DefaultValue (string) --
If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.
PlatformTypes (list) --
The list of OS platforms compatible with this Systems Manager document.
(string) --
DocumentType (string) --
The type of document.
SchemaVersion (string) --
The schema version.
LatestVersion (string) --
The latest version of the document.
DefaultVersion (string) --
The default version.
DocumentFormat (string) --
The document format, either JSON or YAML.
TargetType (string) --
The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .
Tags (list) --
The tags, or metadata, that have been applied to the document.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) --
The name of the tag.
Value (string) --
The value of the tag.
AttachmentsInformation (list) --
Details about the document attachments, including names, locations, sizes, and so on.
(dict) --
An attribute of an attachment, such as the attachment name.
Name (string) --
The name of the attachment.
Requires (list) --
A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document.
(dict) --
An SSM document required by the current document.
Name (string) --
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
Author (string) --
The user in your organization who created the document.
ReviewInformation (list) --
Details about the review of a document.
(dict) --
Information about the result of a document review request.
ReviewedTime (datetime) --
The time that the reviewer took action on the document review request.
Status (string) --
The current status of the document review request.
Reviewer (string) --
The reviewer assigned to take action on the document review request.
ApprovedVersion (string) --
The version of the document currently approved for use in the organization.
PendingReviewVersion (string) --
The version of the document that is currently under review.
ReviewStatus (string) --
The current status of the review.
{'ActualEndTime': 'timestamp', 'ActualStartTime': 'timestamp', 'OpsItemType': 'string', 'PlannedEndTime': 'timestamp', 'PlannedStartTime': 'timestamp'}
Creates a new OpsItem. You must have permission in AWS Identity and Access Management (IAM) to create a new OpsItem. For more information, see Getting started with OpsCenter in the AWS Systems Manager User Guide .
Operations engineers and IT professionals use OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsCenter in the AWS Systems Manager User Guide .
See also: AWS API Documentation
Request Syntax
client.create_ops_item( Description='string', OpsItemType='string', OperationalData={ 'string': { 'Value': 'string', 'Type': 'SearchableString'|'String' } }, Notifications=[ { 'Arn': 'string' }, ], Priority=123, RelatedOpsItems=[ { 'OpsItemId': 'string' }, ], Source='string', Title='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], Category='string', Severity='string', ActualStartTime=datetime(2015, 1, 1), ActualEndTime=datetime(2015, 1, 1), PlannedStartTime=datetime(2015, 1, 1), PlannedEndTime=datetime(2015, 1, 1) )
string
[REQUIRED]
Information about the OpsItem.
string
The type of OpsItem to create. Currently, the only valid values are /aws/changerequest and /aws/issue .
dict
Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.
Warning
Operational data keys can't begin with the following: amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm.
You can choose to make the data searchable by other users in the account or you can restrict search access. Searchable data means that all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. Operational data that is not searchable is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).
Use the /aws/resources key in OperationalData to specify a related resource in the request. Use the /aws/automations key in OperationalData to associate an Automation runbook with the OpsItem. To view AWS CLI example commands that use these keys, see Creating OpsItems manually in the AWS Systems Manager User Guide .
(string) --
(dict) --
An object that defines the value of the key and its type in the OperationalData map.
Value (string) --
The value of the OperationalData key.
Type (string) --
The type of key-value pair. Valid types include SearchableString and String .
list
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
(dict) --
A notification about the OpsItem.
Arn (string) --
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
integer
The importance of this OpsItem in relation to other OpsItems in the system.
list
One or more OpsItems that share something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
(dict) --
An OpsItems that shares something in common with the current OpsItem. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
OpsItemId (string) -- [REQUIRED]
The ID of an OpsItem related to the current OpsItem.
string
[REQUIRED]
The origin of the OpsItem, such as Amazon EC2 or Systems Manager.
Note
The source name can't contain the following strings: aws, amazon, and amzn.
string
[REQUIRED]
A short heading that describes the nature of the OpsItem and the impacted resource.
list
Optional metadata that you assign to a resource. You can restrict access to OpsItems by using an inline IAM policy that specifies tags. For more information, see Getting started with OpsCenter in the AWS Systems Manager User Guide .
Tags use a key-value pair. For example:
Key=Department,Value=Finance
Note
To add tags to an existing OpsItem, use the AddTagsToResource action.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) -- [REQUIRED]
The name of the tag.
Value (string) -- [REQUIRED]
The value of the tag.
string
Specify a category to assign to an OpsItem.
string
Specify a severity to assign to an OpsItem.
datetime
The time a runbook workflow started. Currently reported only for the OpsItem type /aws/changerequest .
datetime
The time a runbook workflow ended. Currently reported only for the OpsItem type /aws/changerequest .
datetime
The time specified in a change request for a runbook workflow to start. Currently supported only for the OpsItem type /aws/changerequest .
datetime
The time specified in a change request for a runbook workflow to end. Currently supported only for the OpsItem type /aws/changerequest .
dict
Response Syntax
{ 'OpsItemId': 'string' }
Response Structure
(dict) --
OpsItemId (string) --
The ID of the OpsItem.
{'AssociationDescription': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
Describes the association for the specified target or instance. If you created the association by using the Targets parameter, then you must retrieve the association by using the association ID. If you created the association by specifying an instance ID and a Systems Manager document, then you retrieve the association by specifying the document name and the instance ID.
See also: AWS API Documentation
Request Syntax
client.describe_association( Name='string', InstanceId='string', AssociationId='string', AssociationVersion='string' )
string
The name of the Systems Manager document.
string
The instance ID.
string
The association ID for which you want information.
string
Specify the association version to retrieve. To view the latest version, either specify $LATEST for this parameter, or omit this parameter. To view a list of all associations for an instance, use ListAssociations . To get a list of versions for a specific association, use ListAssociationVersions .
dict
Response Syntax
{ 'AssociationDescription': { 'Name': 'string', 'InstanceId': 'string', 'AssociationVersion': 'string', 'Date': datetime(2015, 1, 1), 'LastUpdateAssociationDate': datetime(2015, 1, 1), 'Status': { 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' }, 'Overview': { 'Status': 'string', 'DetailedStatus': 'string', 'AssociationStatusAggregatedCount': { 'string': 123 } }, 'DocumentVersion': 'string', 'AutomationTargetParameterName': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AssociationId': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'LastExecutionDate': datetime(2015, 1, 1), 'LastSuccessfulExecutionDate': datetime(2015, 1, 1), 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] } }
Response Structure
(dict) --
AssociationDescription (dict) --
Information about the association.
Name (string) --
The name of the Systems Manager document.
InstanceId (string) --
The ID of the instance.
AssociationVersion (string) --
The association version.
Date (datetime) --
The date when the association was made.
LastUpdateAssociationDate (datetime) --
The date when the association was last updated.
Status (dict) --
The association status.
Date (datetime) --
The date when the status changed.
Name (string) --
The status.
Message (string) --
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
Overview (dict) --
Information about the association.
Status (string) --
The status of the association. Status can be: Pending, Success, or Failed.
DetailedStatus (string) --
A detailed status of the association.
AssociationStatusAggregatedCount (dict) --
Returns the number of targets for the association status. For example, if you created an association with two instances, and one of them was successful, this would return the count of instances by status.
(string) --
(integer) --
DocumentVersion (string) --
The document version.
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AssociationId (string) --
The association ID.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
LastExecutionDate (datetime) --
The date on which the association was last run.
LastSuccessfulExecutionDate (datetime) --
The last date on which the association was successfully run.
AssociationName (string) --
The association name.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you want to run the association.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
{'Filters': {'Key': {'AutomationSubtype', 'OpsItemId'}}}Response
{'AutomationExecutionMetadataList': {'AssociationId': 'string', 'AutomationExecutionStatus': {'Approved', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled'}, 'AutomationSubtype': 'ChangeRequest', 'ChangeRequestName': 'string', 'OpsItemId': 'string', 'Runbooks': [{'DocumentName': 'string', 'DocumentVersion': 'string', 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'Parameters': {'string': ['string']}, 'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}], 'TargetParameterName': 'string', 'Targets': [{'Key': 'string', 'Values': ['string']}]}], 'ScheduledTime': 'timestamp'}}
Provides details about all active and terminated Automation executions.
See also: AWS API Documentation
Request Syntax
client.describe_automation_executions( Filters=[ { 'Key': 'DocumentNamePrefix'|'ExecutionStatus'|'ExecutionId'|'ParentExecutionId'|'CurrentAction'|'StartTimeBefore'|'StartTimeAfter'|'AutomationType'|'TagKey'|'TargetResourceGroup'|'AutomationSubtype'|'OpsItemId', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string' )
list
Filters used to limit the scope of executions that are requested.
(dict) --
A filter used to match specific automation executions. This is used to limit the scope of Automation execution information returned.
Key (string) -- [REQUIRED]
One or more keys to limit the results. Valid filter keys include the following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId, CurrentAction, StartTimeBefore, StartTimeAfter, TargetResourceGroup.
Values (list) -- [REQUIRED]
The values used to limit the execution information associated with the filter's key.
(string) --
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'AutomationExecutionMetadataList': [ { 'AutomationExecutionId': 'string', 'DocumentName': 'string', 'DocumentVersion': 'string', 'AutomationExecutionStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure', 'ExecutionStartTime': datetime(2015, 1, 1), 'ExecutionEndTime': datetime(2015, 1, 1), 'ExecutedBy': 'string', 'LogFile': 'string', 'Outputs': { 'string': [ 'string', ] }, 'Mode': 'Auto'|'Interactive', 'ParentAutomationExecutionId': 'string', 'CurrentStepName': 'string', 'CurrentAction': 'string', 'FailureMessage': 'string', 'TargetParameterName': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'TargetMaps': [ { 'string': [ 'string', ] }, ], 'ResolvedTargets': { 'ParameterValues': [ 'string', ], 'Truncated': True|False }, 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'Target': 'string', 'AutomationType': 'CrossAccount'|'Local', 'AutomationSubtype': 'ChangeRequest', 'ScheduledTime': datetime(2015, 1, 1), 'Runbooks': [ { 'DocumentName': 'string', 'DocumentVersion': 'string', 'Parameters': { 'string': [ 'string', ] }, 'TargetParameterName': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ], 'OpsItemId': 'string', 'AssociationId': 'string', 'ChangeRequestName': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
AutomationExecutionMetadataList (list) --
The list of details about each automation execution which has occurred which matches the filter specification, if any.
(dict) --
Details about a specific Automation execution.
AutomationExecutionId (string) --
The execution ID.
DocumentName (string) --
The name of the Automation document used during execution.
DocumentVersion (string) --
The document version used during the execution.
AutomationExecutionStatus (string) --
The status of the execution.
ExecutionStartTime (datetime) --
The time the execution started.
ExecutionEndTime (datetime) --
The time the execution finished. This is not populated if the execution is still in progress.
ExecutedBy (string) --
The IAM role ARN of the user who ran the Automation.
LogFile (string) --
An S3 bucket where execution information is stored.
Outputs (dict) --
The list of execution outputs as defined in the Automation document.
(string) --
(list) --
(string) --
Mode (string) --
The Automation execution mode.
ParentAutomationExecutionId (string) --
The ExecutionId of the parent Automation.
CurrentStepName (string) --
The name of the step that is currently running.
CurrentAction (string) --
The action of the step that is currently running.
FailureMessage (string) --
The list of execution outputs as defined in the Automation document.
TargetParameterName (string) --
The list of execution outputs as defined in the Automation document.
Targets (list) --
The targets defined by the user when starting the Automation.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
TargetMaps (list) --
The specified key-value mapping of document parameters to target resources.
(dict) --
(string) --
(list) --
(string) --
ResolvedTargets (dict) --
A list of targets that resolved during the execution.
ParameterValues (list) --
A list of parameter values sent to targets that resolved during the Automation execution.
(string) --
Truncated (boolean) --
A boolean value indicating whether the resolved target list is truncated.
MaxConcurrency (string) --
The MaxConcurrency value specified by the user when starting the Automation.
MaxErrors (string) --
The MaxErrors value specified by the user when starting the Automation.
Target (string) --
The list of execution outputs as defined in the Automation document.
AutomationType (string) --
Use this filter with DescribeAutomationExecutions . Specify either Local or CrossAccount. CrossAccount is an Automation that runs in multiple AWS Regions and accounts. For more information, see Running Automation workflows in multiple AWS Regions and accounts in the AWS Systems Manager User Guide .
AutomationSubtype (string) --
The subtype of the Automation operation. Currently, the only supported value is ChangeRequest .
ScheduledTime (datetime) --
The date and time the Automation operation is scheduled to start.
Runbooks (list) --
Information about the Automation runbooks (Automation documents) that are run during a runbook workflow in Change Manager.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
(dict) --
Information about an Automation runbook (Automation document) used in a runbook workflow in Change Manager.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
DocumentName (string) --
The name of the Automation runbook (Automation document) used in a runbook workflow.
DocumentVersion (string) --
The version of the Automation runbook (Automation document) used in a runbook workflow.
Parameters (dict) --
The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .
(string) --
(list) --
(string) --
TargetParameterName (string) --
The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify Targets .
Targets (list) --
A key-value mapping to target resources that the Runbook operation performs tasks on. Required if you specify TargetParameterName .
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
MaxConcurrency (string) --
The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.
MaxErrors (string) --
The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.
TargetLocations (list) --
Information about the AWS Regions and accounts targeted by the current Runbook operation.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
OpsItemId (string) --
The ID of an OpsItem that is created to represent a Change Manager change request.
AssociationId (string) --
The ID of a State Manager association used in the Automation operation.
ChangeRequestName (string) --
The name of the Change Manager change request.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'StepExecutions': {'StepStatus': {'Approved', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled'}}}
Information about all active and terminated step executions in an Automation workflow.
See also: AWS API Documentation
Request Syntax
client.describe_automation_step_executions( AutomationExecutionId='string', Filters=[ { 'Key': 'StartTimeBefore'|'StartTimeAfter'|'StepExecutionStatus'|'StepExecutionId'|'StepName'|'Action', 'Values': [ 'string', ] }, ], NextToken='string', MaxResults=123, ReverseOrder=True|False )
string
[REQUIRED]
The Automation execution ID for which you want step execution descriptions.
list
One or more filters to limit the number of step executions returned by the request.
(dict) --
A filter to limit the amount of step execution information returned by the call.
Key (string) -- [REQUIRED]
One or more keys to limit the results. Valid filter keys include the following: StepName, Action, StepExecutionId, StepExecutionStatus, StartTimeBefore, StartTimeAfter.
Values (list) -- [REQUIRED]
The values of the filter key.
(string) --
string
The token for the next set of items to return. (You received this token from a previous call.)
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
boolean
A boolean that indicates whether to list step executions in reverse order by start time. The default value is false.
dict
Response Syntax
{ 'StepExecutions': [ { 'StepName': 'string', 'Action': 'string', 'TimeoutSeconds': 123, 'OnFailure': 'string', 'MaxAttempts': 123, 'ExecutionStartTime': datetime(2015, 1, 1), 'ExecutionEndTime': datetime(2015, 1, 1), 'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure', 'ResponseCode': 'string', 'Inputs': { 'string': 'string' }, 'Outputs': { 'string': [ 'string', ] }, 'Response': 'string', 'FailureMessage': 'string', 'FailureDetails': { 'FailureStage': 'string', 'FailureType': 'string', 'Details': { 'string': [ 'string', ] } }, 'StepExecutionId': 'string', 'OverriddenParameters': { 'string': [ 'string', ] }, 'IsEnd': True|False, 'NextStep': 'string', 'IsCritical': True|False, 'ValidNextSteps': [ 'string', ], 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'TargetLocation': { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
StepExecutions (list) --
A list of details about the current state of all steps that make up an execution.
(dict) --
Detailed information about an the execution state of an Automation step.
StepName (string) --
The name of this execution step.
Action (string) --
The action this step performs. The action determines the behavior of the step.
TimeoutSeconds (integer) --
The timeout seconds of the step.
OnFailure (string) --
The action to take if the step fails. The default value is Abort.
MaxAttempts (integer) --
The maximum number of tries to run the action of the step. The default value is 1.
ExecutionStartTime (datetime) --
If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field is not populated.
ExecutionEndTime (datetime) --
If a step has finished execution, this contains the time the execution ended. If the step has not yet concluded, this field is not populated.
StepStatus (string) --
The execution status for this step.
ResponseCode (string) --
The response code returned by the execution of the step.
Inputs (dict) --
Fully-resolved values passed into the step before execution.
(string) --
(string) --
Outputs (dict) --
Returned values from the execution of the step.
(string) --
(list) --
(string) --
Response (string) --
A message associated with the response code for an execution.
FailureMessage (string) --
If a step failed, this message explains why the execution failed.
FailureDetails (dict) --
Information about the Automation failure.
FailureStage (string) --
The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.
FailureType (string) --
The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.
Details (dict) --
Detailed information about the Automation step failure.
(string) --
(list) --
(string) --
StepExecutionId (string) --
The unique ID of a step execution.
OverriddenParameters (dict) --
A user-specified list of parameters to override when running a step.
(string) --
(list) --
(string) --
IsEnd (boolean) --
The flag which can be used to end automation no matter whether the step succeeds or fails.
NextStep (string) --
The next step after the step succeeds.
IsCritical (boolean) --
The flag which can be used to help decide whether the failure of current step leads to the Automation failure.
ValidNextSteps (list) --
Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.
(string) --
Targets (list) --
The targets for the step execution.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
TargetLocation (dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'Document': {'ApprovedVersion': 'string', 'Author': 'string', 'DocumentType': {'Automation.ChangeTemplate'}, 'PendingReviewVersion': 'string', 'ReviewInformation': [{'ReviewedTime': 'timestamp', 'Reviewer': 'string', 'Status': 'APPROVED | NOT_REVIEWED | ' 'PENDING | REJECTED'}], 'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | REJECTED'}}
Describes the specified Systems Manager document.
See also: AWS API Documentation
Request Syntax
client.describe_document( Name='string', DocumentVersion='string', VersionName='string' )
string
[REQUIRED]
The name of the Systems Manager document.
string
The document version for which you want information. Can be a specific version or the default version.
string
An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
dict
Response Syntax
{ 'Document': { 'Sha1': 'string', 'Hash': 'string', 'HashType': 'Sha256'|'Sha1', 'Name': 'string', 'VersionName': 'string', 'Owner': 'string', 'CreatedDate': datetime(2015, 1, 1), 'Status': 'Creating'|'Active'|'Updating'|'Deleting'|'Failed', 'StatusInformation': 'string', 'DocumentVersion': 'string', 'Description': 'string', 'Parameters': [ { 'Name': 'string', 'Type': 'String'|'StringList', 'Description': 'string', 'DefaultValue': 'string' }, ], 'PlatformTypes': [ 'Windows'|'Linux', ], 'DocumentType': 'Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', 'SchemaVersion': 'string', 'LatestVersion': 'string', 'DefaultVersion': 'string', 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'TargetType': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AttachmentsInformation': [ { 'Name': 'string' }, ], 'Requires': [ { 'Name': 'string', 'Version': 'string' }, ], 'Author': 'string', 'ReviewInformation': [ { 'ReviewedTime': datetime(2015, 1, 1), 'Status': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED', 'Reviewer': 'string' }, ], 'ApprovedVersion': 'string', 'PendingReviewVersion': 'string', 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED' } }
Response Structure
(dict) --
Document (dict) --
Information about the Systems Manager document.
Sha1 (string) --
The SHA1 hash of the document, which you can use for verification.
Hash (string) --
The Sha256 or Sha1 hash created by the system when the document was created.
Note
Sha1 hashes have been deprecated.
HashType (string) --
The hash type of the document. Valid values include Sha256 or Sha1 .
Note
Sha1 hashes have been deprecated.
Name (string) --
The name of the Systems Manager document.
VersionName (string) --
The version of the artifact associated with the document.
Owner (string) --
The AWS user account that created the document.
CreatedDate (datetime) --
The date when the document was created.
Status (string) --
The status of the Systems Manager document.
StatusInformation (string) --
A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."
DocumentVersion (string) --
The document version.
Description (string) --
A description of the document.
Parameters (list) --
A description of the parameters for a document.
(dict) --
Parameters specified in a System Manager document that run on the server when the command is run.
Name (string) --
The name of the parameter.
Type (string) --
The type of parameter. The type can be either String or StringList.
Description (string) --
A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.
DefaultValue (string) --
If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.
PlatformTypes (list) --
The list of OS platforms compatible with this Systems Manager document.
(string) --
DocumentType (string) --
The type of document.
SchemaVersion (string) --
The schema version.
LatestVersion (string) --
The latest version of the document.
DefaultVersion (string) --
The default version.
DocumentFormat (string) --
The document format, either JSON or YAML.
TargetType (string) --
The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .
Tags (list) --
The tags, or metadata, that have been applied to the document.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) --
The name of the tag.
Value (string) --
The value of the tag.
AttachmentsInformation (list) --
Details about the document attachments, including names, locations, sizes, and so on.
(dict) --
An attribute of an attachment, such as the attachment name.
Name (string) --
The name of the attachment.
Requires (list) --
A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document.
(dict) --
An SSM document required by the current document.
Name (string) --
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
Author (string) --
The user in your organization who created the document.
ReviewInformation (list) --
Details about the review of a document.
(dict) --
Information about the result of a document review request.
ReviewedTime (datetime) --
The time that the reviewer took action on the document review request.
Status (string) --
The current status of the document review request.
Reviewer (string) --
The reviewer assigned to take action on the document review request.
ApprovedVersion (string) --
The version of the document currently approved for use in the organization.
PendingReviewVersion (string) --
The version of the document that is currently under review.
ReviewStatus (string) --
The current status of the review.
{'OpsItemFilters': {'Key': {'ActualEndTime', 'ActualStartTime', 'ChangeRequestByApproverArn', 'ChangeRequestByApproverName', 'ChangeRequestByRequesterArn', 'ChangeRequestByRequesterName', 'ChangeRequestByTargetsResourceGroup', 'ChangeRequestByTemplate', 'OpsItemType', 'PlannedEndTime', 'PlannedStartTime'}}}Response
{'OpsItemSummaries': {'ActualEndTime': 'timestamp', 'ActualStartTime': 'timestamp', 'OpsItemType': 'string', 'PlannedEndTime': 'timestamp', 'PlannedStartTime': 'timestamp', 'Status': {'Approved', 'Cancelled', 'Cancelling', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'Failed', 'Pending', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled', 'TimedOut'}}}
Query a set of OpsItems. You must have permission in AWS Identity and Access Management (IAM) to query a list of OpsItems. For more information, see Getting started with OpsCenter in the AWS Systems Manager User Guide .
Operations engineers and IT professionals use OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsCenter in the AWS Systems Manager User Guide .
See also: AWS API Documentation
Request Syntax
client.describe_ops_items( OpsItemFilters=[ { 'Key': 'Status'|'CreatedBy'|'Source'|'Priority'|'Title'|'OpsItemId'|'CreatedTime'|'LastModifiedTime'|'ActualStartTime'|'ActualEndTime'|'PlannedStartTime'|'PlannedEndTime'|'OperationalData'|'OperationalDataKey'|'OperationalDataValue'|'ResourceId'|'AutomationId'|'Category'|'Severity'|'OpsItemType'|'ChangeRequestByRequesterArn'|'ChangeRequestByRequesterName'|'ChangeRequestByApproverArn'|'ChangeRequestByApproverName'|'ChangeRequestByTemplate'|'ChangeRequestByTargetsResourceGroup', 'Values': [ 'string', ], 'Operator': 'Equal'|'Contains'|'GreaterThan'|'LessThan' }, ], MaxResults=123, NextToken='string' )
list
One or more filters to limit the response.
Key: CreatedTime Operations: GreaterThan, LessThan
Key: LastModifiedBy Operations: Contains, Equals
Key: LastModifiedTime Operations: GreaterThan, LessThan
Key: Priority Operations: Equals
Key: Source Operations: Contains, Equals
Key: Status Operations: Equals
Key: Title Operations: Contains
Key: OperationalData* Operations: Equals
Key: OperationalDataKey Operations: Equals
Key: OperationalDataValue Operations: Equals, Contains
Key: OpsItemId Operations: Equals
Key: ResourceId Operations: Contains
Key: AutomationId Operations: Equals
*If you filter the response by using the OperationalData operator, specify a key-value pair by using the following JSON format: {"key":"key_name","value":"a_value"}
(dict) --
Describes an OpsItem filter.
Key (string) -- [REQUIRED]
The name of the filter.
Values (list) -- [REQUIRED]
The filter value.
(string) --
Operator (string) -- [REQUIRED]
The operator used by the filter call.
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
A token to start the list. Use this token to get the next set of results.
dict
Response Syntax
{ 'NextToken': 'string', 'OpsItemSummaries': [ { 'CreatedBy': 'string', 'CreatedTime': datetime(2015, 1, 1), 'LastModifiedBy': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'Priority': 123, 'Source': 'string', 'Status': 'Open'|'InProgress'|'Resolved'|'Pending'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'CompletedWithSuccess'|'CompletedWithFailure'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'PendingApproval'|'Approved'|'Rejected', 'OpsItemId': 'string', 'Title': 'string', 'OperationalData': { 'string': { 'Value': 'string', 'Type': 'SearchableString'|'String' } }, 'Category': 'string', 'Severity': 'string', 'OpsItemType': 'string', 'ActualStartTime': datetime(2015, 1, 1), 'ActualEndTime': datetime(2015, 1, 1), 'PlannedStartTime': datetime(2015, 1, 1), 'PlannedEndTime': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) --
NextToken (string) --
The token for the next set of items to return. Use this token to get the next set of results.
OpsItemSummaries (list) --
A list of OpsItems.
(dict) --
A count of OpsItems.
CreatedBy (string) --
The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
CreatedTime (datetime) --
The date and time the OpsItem was created.
LastModifiedBy (string) --
The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.
LastModifiedTime (datetime) --
The date and time the OpsItem was last updated.
Priority (integer) --
The importance of this OpsItem in relation to other OpsItems in the system.
Source (string) --
The impacted AWS resource.
Status (string) --
The OpsItem status. Status can be Open , In Progress , or Resolved .
OpsItemId (string) --
The ID of the OpsItem.
Title (string) --
A short heading that describes the nature of the OpsItem and the impacted resource.
OperationalData (dict) --
Operational data is custom data that provides useful reference details about the OpsItem.
(string) --
(dict) --
An object that defines the value of the key and its type in the OperationalData map.
Value (string) --
The value of the OperationalData key.
Type (string) --
The type of key-value pair. Valid types include SearchableString and String .
Category (string) --
A list of OpsItems by category.
Severity (string) --
A list of OpsItems by severity.
OpsItemType (string) --
The type of OpsItem. Currently, the only valid values are /aws/changerequest and /aws/issue .
ActualStartTime (datetime) --
The time a runbook workflow started. Currently reported only for the OpsItem type /aws/changerequest .
ActualEndTime (datetime) --
The time a runbook workflow ended. Currently reported only for the OpsItem type /aws/changerequest .
PlannedStartTime (datetime) --
The time specified in a change request for a runbook workflow to start. Currently supported only for the OpsItem type /aws/changerequest .
PlannedEndTime (datetime) --
The time specified in a change request for a runbook workflow to end. Currently supported only for the OpsItem type /aws/changerequest .
{'AutomationExecution': {'AssociationId': 'string', 'AutomationExecutionStatus': {'Approved', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled'}, 'AutomationSubtype': 'ChangeRequest', 'ChangeRequestName': 'string', 'OpsItemId': 'string', 'Runbooks': [{'DocumentName': 'string', 'DocumentVersion': 'string', 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'Parameters': {'string': ['string']}, 'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}], 'TargetParameterName': 'string', 'Targets': [{'Key': 'string', 'Values': ['string']}]}], 'ScheduledTime': 'timestamp', 'StepExecutions': {'StepStatus': {'Approved', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled'}}}}
Get detailed information about a particular Automation execution.
See also: AWS API Documentation
Request Syntax
client.get_automation_execution( AutomationExecutionId='string' )
string
[REQUIRED]
The unique identifier for an existing automation execution to examine. The execution ID is returned by StartAutomationExecution when the execution of an Automation document is initiated.
dict
Response Syntax
{ 'AutomationExecution': { 'AutomationExecutionId': 'string', 'DocumentName': 'string', 'DocumentVersion': 'string', 'ExecutionStartTime': datetime(2015, 1, 1), 'ExecutionEndTime': datetime(2015, 1, 1), 'AutomationExecutionStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure', 'StepExecutions': [ { 'StepName': 'string', 'Action': 'string', 'TimeoutSeconds': 123, 'OnFailure': 'string', 'MaxAttempts': 123, 'ExecutionStartTime': datetime(2015, 1, 1), 'ExecutionEndTime': datetime(2015, 1, 1), 'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure', 'ResponseCode': 'string', 'Inputs': { 'string': 'string' }, 'Outputs': { 'string': [ 'string', ] }, 'Response': 'string', 'FailureMessage': 'string', 'FailureDetails': { 'FailureStage': 'string', 'FailureType': 'string', 'Details': { 'string': [ 'string', ] } }, 'StepExecutionId': 'string', 'OverriddenParameters': { 'string': [ 'string', ] }, 'IsEnd': True|False, 'NextStep': 'string', 'IsCritical': True|False, 'ValidNextSteps': [ 'string', ], 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'TargetLocation': { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' } }, ], 'StepExecutionsTruncated': True|False, 'Parameters': { 'string': [ 'string', ] }, 'Outputs': { 'string': [ 'string', ] }, 'FailureMessage': 'string', 'Mode': 'Auto'|'Interactive', 'ParentAutomationExecutionId': 'string', 'ExecutedBy': 'string', 'CurrentStepName': 'string', 'CurrentAction': 'string', 'TargetParameterName': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'TargetMaps': [ { 'string': [ 'string', ] }, ], 'ResolvedTargets': { 'ParameterValues': [ 'string', ], 'Truncated': True|False }, 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'Target': 'string', 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ], 'ProgressCounters': { 'TotalSteps': 123, 'SuccessSteps': 123, 'FailedSteps': 123, 'CancelledSteps': 123, 'TimedOutSteps': 123 }, 'AutomationSubtype': 'ChangeRequest', 'ScheduledTime': datetime(2015, 1, 1), 'Runbooks': [ { 'DocumentName': 'string', 'DocumentVersion': 'string', 'Parameters': { 'string': [ 'string', ] }, 'TargetParameterName': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'MaxConcurrency': 'string', 'MaxErrors': 'string', 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ], 'OpsItemId': 'string', 'AssociationId': 'string', 'ChangeRequestName': 'string' } }
Response Structure
(dict) --
AutomationExecution (dict) --
Detailed information about the current state of an automation execution.
AutomationExecutionId (string) --
The execution ID.
DocumentName (string) --
The name of the Automation document used during the execution.
DocumentVersion (string) --
The version of the document to use during execution.
ExecutionStartTime (datetime) --
The time the execution started.
ExecutionEndTime (datetime) --
The time the execution finished.
AutomationExecutionStatus (string) --
The execution status of the Automation.
StepExecutions (list) --
A list of details about the current state of all steps that comprise an execution. An Automation document contains a list of steps that are run in order.
(dict) --
Detailed information about an the execution state of an Automation step.
StepName (string) --
The name of this execution step.
Action (string) --
The action this step performs. The action determines the behavior of the step.
TimeoutSeconds (integer) --
The timeout seconds of the step.
OnFailure (string) --
The action to take if the step fails. The default value is Abort.
MaxAttempts (integer) --
The maximum number of tries to run the action of the step. The default value is 1.
ExecutionStartTime (datetime) --
If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field is not populated.
ExecutionEndTime (datetime) --
If a step has finished execution, this contains the time the execution ended. If the step has not yet concluded, this field is not populated.
StepStatus (string) --
The execution status for this step.
ResponseCode (string) --
The response code returned by the execution of the step.
Inputs (dict) --
Fully-resolved values passed into the step before execution.
(string) --
(string) --
Outputs (dict) --
Returned values from the execution of the step.
(string) --
(list) --
(string) --
Response (string) --
A message associated with the response code for an execution.
FailureMessage (string) --
If a step failed, this message explains why the execution failed.
FailureDetails (dict) --
Information about the Automation failure.
FailureStage (string) --
The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.
FailureType (string) --
The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.
Details (dict) --
Detailed information about the Automation step failure.
(string) --
(list) --
(string) --
StepExecutionId (string) --
The unique ID of a step execution.
OverriddenParameters (dict) --
A user-specified list of parameters to override when running a step.
(string) --
(list) --
(string) --
IsEnd (boolean) --
The flag which can be used to end automation no matter whether the step succeeds or fails.
NextStep (string) --
The next step after the step succeeds.
IsCritical (boolean) --
The flag which can be used to help decide whether the failure of current step leads to the Automation failure.
ValidNextSteps (list) --
Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.
(string) --
Targets (list) --
The targets for the step execution.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
TargetLocation (dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
StepExecutionsTruncated (boolean) --
A boolean value that indicates if the response contains the full list of the Automation step executions. If true, use the DescribeAutomationStepExecutions API action to get the full list of step executions.
Parameters (dict) --
The key-value map of execution parameters, which were supplied when calling StartAutomationExecution.
(string) --
(list) --
(string) --
Outputs (dict) --
The list of execution outputs as defined in the automation document.
(string) --
(list) --
(string) --
FailureMessage (string) --
A message describing why an execution has failed, if the status is set to Failed.
Mode (string) --
The automation execution mode.
ParentAutomationExecutionId (string) --
The AutomationExecutionId of the parent automation.
ExecutedBy (string) --
The Amazon Resource Name (ARN) of the user who ran the automation.
CurrentStepName (string) --
The name of the step that is currently running.
CurrentAction (string) --
The action of the step that is currently running.
TargetParameterName (string) --
The parameter name.
Targets (list) --
The specified targets.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
TargetMaps (list) --
The specified key-value mapping of document parameters to target resources.
(dict) --
(string) --
(list) --
(string) --
ResolvedTargets (dict) --
A list of resolved targets in the rate control execution.
ParameterValues (list) --
A list of parameter values sent to targets that resolved during the Automation execution.
(string) --
Truncated (boolean) --
A boolean value indicating whether the resolved target list is truncated.
MaxConcurrency (string) --
The MaxConcurrency value specified by the user when the execution started.
MaxErrors (string) --
The MaxErrors value specified by the user when the execution started.
Target (string) --
The target of the execution.
TargetLocations (list) --
The combination of AWS Regions and/or AWS accounts where you want to run the Automation.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
ProgressCounters (dict) --
An aggregate of step execution statuses displayed in the AWS Console for a multi-Region and multi-account Automation execution.
TotalSteps (integer) --
The total number of steps run in all specified AWS Regions and accounts for the current Automation execution.
SuccessSteps (integer) --
The total number of steps that successfully completed in all specified AWS Regions and accounts for the current Automation execution.
FailedSteps (integer) --
The total number of steps that failed to run in all specified AWS Regions and accounts for the current Automation execution.
CancelledSteps (integer) --
The total number of steps that the system cancelled in all specified AWS Regions and accounts for the current Automation execution.
TimedOutSteps (integer) --
The total number of steps that timed out in all specified AWS Regions and accounts for the current Automation execution.
AutomationSubtype (string) --
The subtype of the Automation operation. Currently, the only supported value is ChangeRequest .
ScheduledTime (datetime) --
The date and time the Automation operation is scheduled to start.
Runbooks (list) --
Information about the Automation runbooks (Automation documents) that are run as part of a runbook workflow.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
(dict) --
Information about an Automation runbook (Automation document) used in a runbook workflow in Change Manager.
Note
The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.
DocumentName (string) --
The name of the Automation runbook (Automation document) used in a runbook workflow.
DocumentVersion (string) --
The version of the Automation runbook (Automation document) used in a runbook workflow.
Parameters (dict) --
The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .
(string) --
(list) --
(string) --
TargetParameterName (string) --
The name of the parameter used as the target resource for the rate-controlled runbook workflow. Required if you specify Targets .
Targets (list) --
A key-value mapping to target resources that the Runbook operation performs tasks on. Required if you specify TargetParameterName .
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
MaxConcurrency (string) --
The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.
MaxErrors (string) --
The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.
TargetLocations (list) --
Information about the AWS Regions and accounts targeted by the current Runbook operation.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
OpsItemId (string) --
The ID of an OpsItem that is created to represent a Change Manager change request.
AssociationId (string) --
The ID of a State Manager association used in the Automation operation.
ChangeRequestName (string) --
The name of the Change Manager change request.
{'DocumentType': {'Automation.ChangeTemplate'}, 'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | REJECTED'}
Gets the contents of the specified Systems Manager document.
See also: AWS API Documentation
Request Syntax
client.get_document( Name='string', VersionName='string', DocumentVersion='string', DocumentFormat='YAML'|'JSON'|'TEXT' )
string
[REQUIRED]
The name of the Systems Manager document.
string
An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document and can't be changed.
string
The document version for which you want information.
string
Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.
dict
Response Syntax
{ 'Name': 'string', 'VersionName': 'string', 'DocumentVersion': 'string', 'Status': 'Creating'|'Active'|'Updating'|'Deleting'|'Failed', 'StatusInformation': 'string', 'Content': 'string', 'DocumentType': 'Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'Requires': [ { 'Name': 'string', 'Version': 'string' }, ], 'AttachmentsContent': [ { 'Name': 'string', 'Size': 123, 'Hash': 'string', 'HashType': 'Sha256', 'Url': 'string' }, ], 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED' }
Response Structure
(dict) --
Name (string) --
The name of the Systems Manager document.
VersionName (string) --
The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
DocumentVersion (string) --
The document version.
Status (string) --
The status of the Systems Manager document, such as Creating , Active , Updating , Failed , and Deleting .
StatusInformation (string) --
A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."
Content (string) --
The contents of the Systems Manager document.
DocumentType (string) --
The document type.
DocumentFormat (string) --
The document format, either JSON or YAML.
Requires (list) --
A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document.
(dict) --
An SSM document required by the current document.
Name (string) --
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
AttachmentsContent (list) --
A description of the document attachments, including names, locations, sizes, and so on.
(dict) --
A structure that includes attributes that describe a document attachment.
Name (string) --
The name of an attachment.
Size (integer) --
The size of an attachment in bytes.
Hash (string) --
The cryptographic hash value of the document content.
HashType (string) --
The hash algorithm used to calculate the hash value.
Url (string) --
The URL location of the attachment content.
ReviewStatus (string) --
The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.
Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.
Only one version of an SSM document can be in review, or PENDING, at a time.
{'OpsItem': {'ActualEndTime': 'timestamp', 'ActualStartTime': 'timestamp', 'OpsItemType': 'string', 'PlannedEndTime': 'timestamp', 'PlannedStartTime': 'timestamp', 'Status': {'Approved', 'Cancelled', 'Cancelling', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'Failed', 'Pending', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled', 'TimedOut'}}}
Get information about an OpsItem by using the ID. You must have permission in AWS Identity and Access Management (IAM) to view information about an OpsItem. For more information, see Getting started with OpsCenter in the AWS Systems Manager User Guide .
Operations engineers and IT professionals use OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsCenter in the AWS Systems Manager User Guide .
See also: AWS API Documentation
Request Syntax
client.get_ops_item( OpsItemId='string' )
string
[REQUIRED]
The ID of the OpsItem that you want to get.
dict
Response Syntax
{ 'OpsItem': { 'CreatedBy': 'string', 'OpsItemType': 'string', 'CreatedTime': datetime(2015, 1, 1), 'Description': 'string', 'LastModifiedBy': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'Notifications': [ { 'Arn': 'string' }, ], 'Priority': 123, 'RelatedOpsItems': [ { 'OpsItemId': 'string' }, ], 'Status': 'Open'|'InProgress'|'Resolved'|'Pending'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'CompletedWithSuccess'|'CompletedWithFailure'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'PendingApproval'|'Approved'|'Rejected', 'OpsItemId': 'string', 'Version': 'string', 'Title': 'string', 'Source': 'string', 'OperationalData': { 'string': { 'Value': 'string', 'Type': 'SearchableString'|'String' } }, 'Category': 'string', 'Severity': 'string', 'ActualStartTime': datetime(2015, 1, 1), 'ActualEndTime': datetime(2015, 1, 1), 'PlannedStartTime': datetime(2015, 1, 1), 'PlannedEndTime': datetime(2015, 1, 1) } }
Response Structure
(dict) --
OpsItem (dict) --
The OpsItem.
CreatedBy (string) --
The ARN of the AWS account that created the OpsItem.
OpsItemType (string) --
The type of OpsItem. Currently, the only valid values are /aws/changerequest and /aws/issue .
CreatedTime (datetime) --
The date and time the OpsItem was created.
Description (string) --
The OpsItem description.
LastModifiedBy (string) --
The ARN of the AWS account that last updated the OpsItem.
LastModifiedTime (datetime) --
The date and time the OpsItem was last updated.
Notifications (list) --
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
(dict) --
A notification about the OpsItem.
Arn (string) --
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
Priority (integer) --
The importance of this OpsItem in relation to other OpsItems in the system.
RelatedOpsItems (list) --
One or more OpsItems that share something in common with the current OpsItem. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
(dict) --
An OpsItems that shares something in common with the current OpsItem. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
OpsItemId (string) --
The ID of an OpsItem related to the current OpsItem.
Status (string) --
The OpsItem status. Status can be Open , In Progress , or Resolved . For more information, see Editing OpsItem details in the AWS Systems Manager User Guide .
OpsItemId (string) --
The ID of the OpsItem.
Version (string) --
The version of this OpsItem. Each time the OpsItem is edited the version number increments by one.
Title (string) --
A short heading that describes the nature of the OpsItem and the impacted resource.
Source (string) --
The origin of the OpsItem, such as Amazon EC2 or Systems Manager. The impacted resource is a subset of source.
OperationalData (dict) --
Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.
Warning
Operational data keys can't begin with the following: amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm.
You can choose to make the data searchable by other users in the account or you can restrict search access. Searchable data means that all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. Operational data that is not searchable is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).
Use the /aws/resources key in OperationalData to specify a related resource in the request. Use the /aws/automations key in OperationalData to associate an Automation runbook with the OpsItem. To view AWS CLI example commands that use these keys, see Creating OpsItems manually in the AWS Systems Manager User Guide .
(string) --
(dict) --
An object that defines the value of the key and its type in the OperationalData map.
Value (string) --
The value of the OperationalData key.
Type (string) --
The type of key-value pair. Valid types include SearchableString and String .
Category (string) --
An OpsItem category. Category options include: Availability, Cost, Performance, Recovery, Security.
Severity (string) --
The severity of the OpsItem. Severity options range from 1 to 4.
ActualStartTime (datetime) --
The time a runbook workflow started. Currently reported only for the OpsItem type /aws/changerequest .
ActualEndTime (datetime) --
The time a runbook workflow ended. Currently reported only for the OpsItem type /aws/changerequest .
PlannedStartTime (datetime) --
The time specified in a change request for a runbook workflow to start. Currently supported only for the OpsItem type /aws/changerequest .
PlannedEndTime (datetime) --
The time specified in a change request for a runbook workflow to end. Currently supported only for the OpsItem type /aws/changerequest .
{'AssociationVersions': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
Retrieves all versions of an association for a specific association ID.
See also: AWS API Documentation
Request Syntax
client.list_association_versions( AssociationId='string', MaxResults=123, NextToken='string' )
string
[REQUIRED]
The association ID for which you want to view all versions.
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
A token to start the list. Use this token to get the next set of results.
dict
Response Syntax
{ 'AssociationVersions': [ { 'AssociationId': 'string', 'AssociationVersion': 'string', 'CreatedDate': datetime(2015, 1, 1), 'Name': 'string', 'DocumentVersion': 'string', 'Parameters': { 'string': [ 'string', ] }, 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) --
AssociationVersions (list) --
Information about all versions of the association for the specified association ID.
(dict) --
Information about the association version.
AssociationId (string) --
The ID created by the system when the association was created.
AssociationVersion (string) --
The association version.
CreatedDate (datetime) --
The date the association version was created.
Name (string) --
The name specified when the association was created.
DocumentVersion (string) --
The version of a Systems Manager document used when the association version was created.
Parameters (dict) --
Parameters specified when the association version was created.
(string) --
(list) --
(string) --
Targets (list) --
The targets specified for the association when the association version was created.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
The cron or rate schedule specified for the association when the association version was created.
OutputLocation (dict) --
The location in Amazon S3 specified for the association when the association version was created.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
AssociationName (string) --
The name specified for the association version when the association version was created.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you wanted to run the association when this association version was created.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
NextToken (string) --
The token for the next set of items to return. Use this token to get the next set of results.
{'DocumentVersions': {'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | ' 'REJECTED'}}
List all versions for a document.
See also: AWS API Documentation
Request Syntax
client.list_document_versions( Name='string', MaxResults=123, NextToken='string' )
string
[REQUIRED]
The name of the document. You can specify an Amazon Resource Name (ARN).
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'DocumentVersions': [ { 'Name': 'string', 'DocumentVersion': 'string', 'VersionName': 'string', 'CreatedDate': datetime(2015, 1, 1), 'IsDefaultVersion': True|False, 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'Status': 'Creating'|'Active'|'Updating'|'Deleting'|'Failed', 'StatusInformation': 'string', 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
DocumentVersions (list) --
The document versions.
(dict) --
Version information about the document.
Name (string) --
The document name.
DocumentVersion (string) --
The document version.
VersionName (string) --
The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
CreatedDate (datetime) --
The date the document was created.
IsDefaultVersion (boolean) --
An identifier for the default version of the document.
DocumentFormat (string) --
The document format, either JSON or YAML.
Status (string) --
The status of the Systems Manager document, such as Creating , Active , Failed , and Deleting .
StatusInformation (string) --
A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."
ReviewStatus (string) --
The current status of the approval review for the latest version of the document.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'DocumentIdentifiers': {'Author': 'string', 'DocumentType': {'Automation.ChangeTemplate'}, 'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | ' 'REJECTED'}}
Returns all Systems Manager (SSM) documents in the current AWS account and Region. You can limit the results of this request by using a filter.
See also: AWS API Documentation
Request Syntax
client.list_documents( DocumentFilterList=[ { 'key': 'Name'|'Owner'|'PlatformTypes'|'DocumentType', 'value': 'string' }, ], Filters=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], MaxResults=123, NextToken='string' )
list
This data type is deprecated. Instead, use Filters .
(dict) --
This data type is deprecated. Instead, use DocumentKeyValuesFilter .
key (string) -- [REQUIRED]
The name of the filter.
value (string) -- [REQUIRED]
The value of the filter.
list
One or more DocumentKeyValuesFilter objects. Use a filter to return a more specific list of results. For keys, you can specify one or more key-value pair tags that have been applied to a document. Other valid keys include Owner , Name , PlatformTypes , DocumentType , and TargetType . For example, to return documents you own use Key=Owner,Values=Self . To specify a custom key-value pair, use the format Key=tag:tagName,Values=valueName .
(dict) --
One or more filters. Use a filter to return a more specific list of documents.
For keys, you can specify one or more tags that have been applied to a document.
You can also use AWS-provided keys, some of which have specific allowed values. These keys and their associated values are as follows:
DocumentType
ApplicationConfiguration
ApplicationConfigurationSchema
Automation
ChangeCalendar
Command
DeploymentStrategy
Package
Policy
Session
Owner
Note that only one Owner can be specified in a request. For example: Key=Owner,Values=Self .
Amazon
Private
Public
Self
ThirdParty
PlatformTypes
Linux
Windows
Name is another AWS-provided key. If you use Name as a key, you can use a name prefix to return a list of documents. For example, in the AWS CLI, to return a list of all documents that begin with Te , run the following command:
aws ssm list-documents --filters Key=Name,Values=Te
You can also use the TargetType AWS-provided key. For a list of valid resource type values that can be used with this key, see AWS resource and property types reference in the AWS CloudFormation User Guide .
If you specify more than two keys, only documents that are identified by all the tags are returned in the results. If you specify more than two values for a key, documents that are identified by any of the values are returned in the results.
To specify a custom key and value pair, use the format Key=tag:tagName,Values=valueName .
For example, if you created a key called region and are using the AWS CLI to call the list-documents command:
aws ssm list-documents --filters Key=tag:region,Values=east,west Key=Owner,Values=Self
Key (string) --
The name of the filter key.
Values (list) --
The value for the filter key.
(string) --
integer
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'DocumentIdentifiers': [ { 'Name': 'string', 'Owner': 'string', 'VersionName': 'string', 'PlatformTypes': [ 'Windows'|'Linux', ], 'DocumentVersion': 'string', 'DocumentType': 'Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', 'SchemaVersion': 'string', 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'TargetType': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'Requires': [ { 'Name': 'string', 'Version': 'string' }, ], 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED', 'Author': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
DocumentIdentifiers (list) --
The names of the Systems Manager documents.
(dict) --
Describes the name of a Systems Manager document.
Name (string) --
The name of the Systems Manager document.
Owner (string) --
The AWS user account that created the document.
VersionName (string) --
An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
PlatformTypes (list) --
The operating system platform.
(string) --
DocumentVersion (string) --
The document version.
DocumentType (string) --
The document type.
SchemaVersion (string) --
The schema version.
DocumentFormat (string) --
The document format, either JSON or YAML.
TargetType (string) --
The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .
Tags (list) --
The tags, or metadata, that have been applied to the document.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) --
The name of the tag.
Value (string) --
The value of the tag.
Requires (list) --
A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document.
(dict) --
An SSM document required by the current document.
Name (string) --
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
ReviewStatus (string) --
The current status of a document review.
Author (string) --
The user in your organization who created the document.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}Response
{'AssociationDescription': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
Updates an association. You can update the association name and version, the document version, schedule, parameters, and Amazon S3 output.
In order to call this API action, your IAM user account, group, or role must be configured with permission to call the DescribeAssociation API action. If you don't have permission to call DescribeAssociation, then you receive the following error: An error occurred (AccessDeniedException) when calling the UpdateAssociation operation: User: <user_arn> is not authorized to perform: ssm:DescribeAssociation on resource: <resource_arn>
Warning
When you update an association, the association immediately runs against the specified targets.
See also: AWS API Documentation
Request Syntax
client.update_association( AssociationId='string', Parameters={ 'string': [ 'string', ] }, DocumentVersion='string', ScheduleExpression='string', OutputLocation={ 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, Name='string', Targets=[ { 'Key': 'string', 'Values': [ 'string', ] }, ], AssociationName='string', AssociationVersion='string', AutomationTargetParameterName='string', MaxErrors='string', MaxConcurrency='string', ComplianceSeverity='CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', SyncCompliance='AUTO'|'MANUAL', ApplyOnlyAtCronInterval=True|False, TargetLocations=[ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] )
string
[REQUIRED]
The ID of the association you want to update.
dict
The parameters you want to update for the association. If you create a parameter using Parameter Store, you can reference the parameter using {{ssm:parameter-name}}
(string) --
(list) --
(string) --
string
The document version you want update for the association.
string
The cron expression used to schedule the association that you want to update.
dict
An S3 bucket where you want to store the results of this request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
string
The name of the SSM document that contains the configuration information for the instance. You can specify Command or Automation documents.
You can specify AWS-predefined documents, documents you created, or a document that is shared with you from another account.
For SSM documents that are shared with you from other AWS accounts, you must specify the complete SSM document ARN, in the following format:
``arn:aws:ssm:region :account-id :document/document-name ``
For example:
arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document
For AWS-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .
list
The targets of the association.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
string
The name of the association that you want to update.
string
This parameter is provided for concurrency control purposes. You must specify the latest association version in the service. If you want to ensure that this request succeeds, either specify $LATEST , or omit this parameter.
string
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
string
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
string
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
string
The severity level to assign to the association.
string
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
boolean
By default, when you update an association, the system runs it immediately after it is updated and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you update it. This parameter is not supported for rate expressions.
Also, if you specified this option when you created the association, you can reset it. To do so, specify the no-apply-only-at-cron-interval parameter when you update the association from the command line. This parameter forces the association to run immediately after updating it and according to the interval specified.
list
A location is a combination of AWS Regions and AWS accounts where you want to run the association. Use this action to update an association in multiple Regions and multiple accounts.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
dict
Response Syntax
{ 'AssociationDescription': { 'Name': 'string', 'InstanceId': 'string', 'AssociationVersion': 'string', 'Date': datetime(2015, 1, 1), 'LastUpdateAssociationDate': datetime(2015, 1, 1), 'Status': { 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' }, 'Overview': { 'Status': 'string', 'DetailedStatus': 'string', 'AssociationStatusAggregatedCount': { 'string': 123 } }, 'DocumentVersion': 'string', 'AutomationTargetParameterName': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AssociationId': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'LastExecutionDate': datetime(2015, 1, 1), 'LastSuccessfulExecutionDate': datetime(2015, 1, 1), 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] } }
Response Structure
(dict) --
AssociationDescription (dict) --
The description of the association that was updated.
Name (string) --
The name of the Systems Manager document.
InstanceId (string) --
The ID of the instance.
AssociationVersion (string) --
The association version.
Date (datetime) --
The date when the association was made.
LastUpdateAssociationDate (datetime) --
The date when the association was last updated.
Status (dict) --
The association status.
Date (datetime) --
The date when the status changed.
Name (string) --
The status.
Message (string) --
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
Overview (dict) --
Information about the association.
Status (string) --
The status of the association. Status can be: Pending, Success, or Failed.
DetailedStatus (string) --
A detailed status of the association.
AssociationStatusAggregatedCount (dict) --
Returns the number of targets for the association status. For example, if you created an association with two instances, and one of them was successful, this would return the count of instances by status.
(string) --
(integer) --
DocumentVersion (string) --
The document version.
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AssociationId (string) --
The association ID.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
LastExecutionDate (datetime) --
The date on which the association was last run.
LastSuccessfulExecutionDate (datetime) --
The last date on which the association was successfully run.
AssociationName (string) --
The association name.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you want to run the association.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
{'AssociationDescription': {'TargetLocations': [{'Accounts': ['string'], 'ExecutionRoleName': 'string', 'Regions': ['string'], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string'}]}}
Updates the status of the Systems Manager document associated with the specified instance.
See also: AWS API Documentation
Request Syntax
client.update_association_status( Name='string', InstanceId='string', AssociationStatus={ 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' } )
string
[REQUIRED]
The name of the Systems Manager document.
string
[REQUIRED]
The ID of the instance.
dict
[REQUIRED]
The association status.
Date (datetime) -- [REQUIRED]
The date when the status changed.
Name (string) -- [REQUIRED]
The status.
Message (string) -- [REQUIRED]
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
dict
Response Syntax
{ 'AssociationDescription': { 'Name': 'string', 'InstanceId': 'string', 'AssociationVersion': 'string', 'Date': datetime(2015, 1, 1), 'LastUpdateAssociationDate': datetime(2015, 1, 1), 'Status': { 'Date': datetime(2015, 1, 1), 'Name': 'Pending'|'Success'|'Failed', 'Message': 'string', 'AdditionalInfo': 'string' }, 'Overview': { 'Status': 'string', 'DetailedStatus': 'string', 'AssociationStatusAggregatedCount': { 'string': 123 } }, 'DocumentVersion': 'string', 'AutomationTargetParameterName': 'string', 'Parameters': { 'string': [ 'string', ] }, 'AssociationId': 'string', 'Targets': [ { 'Key': 'string', 'Values': [ 'string', ] }, ], 'ScheduleExpression': 'string', 'OutputLocation': { 'S3Location': { 'OutputS3Region': 'string', 'OutputS3BucketName': 'string', 'OutputS3KeyPrefix': 'string' } }, 'LastExecutionDate': datetime(2015, 1, 1), 'LastSuccessfulExecutionDate': datetime(2015, 1, 1), 'AssociationName': 'string', 'MaxErrors': 'string', 'MaxConcurrency': 'string', 'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED', 'SyncCompliance': 'AUTO'|'MANUAL', 'ApplyOnlyAtCronInterval': True|False, 'TargetLocations': [ { 'Accounts': [ 'string', ], 'Regions': [ 'string', ], 'TargetLocationMaxConcurrency': 'string', 'TargetLocationMaxErrors': 'string', 'ExecutionRoleName': 'string' }, ] } }
Response Structure
(dict) --
AssociationDescription (dict) --
Information about the association.
Name (string) --
The name of the Systems Manager document.
InstanceId (string) --
The ID of the instance.
AssociationVersion (string) --
The association version.
Date (datetime) --
The date when the association was made.
LastUpdateAssociationDate (datetime) --
The date when the association was last updated.
Status (dict) --
The association status.
Date (datetime) --
The date when the status changed.
Name (string) --
The status.
Message (string) --
The reason for the status.
AdditionalInfo (string) --
A user-defined string.
Overview (dict) --
Information about the association.
Status (string) --
The status of the association. Status can be: Pending, Success, or Failed.
DetailedStatus (string) --
A detailed status of the association.
AssociationStatusAggregatedCount (dict) --
Returns the number of targets for the association status. For example, if you created an association with two instances, and one of them was successful, this would return the count of instances by status.
(string) --
(integer) --
DocumentVersion (string) --
The document version.
AutomationTargetParameterName (string) --
Specify the target for the association. This target is required for associations that use an Automation document and target resources by using rate controls.
Parameters (dict) --
A description of the parameters for a document.
(string) --
(list) --
(string) --
AssociationId (string) --
The association ID.
Targets (list) --
The instances targeted by the request.
(dict) --
An array of search criteria that targets instances using a Key,Value combination that you specify.
Supported formats include the following.
``Key=InstanceIds,Values=*instance-id-1* ,*instance-id-2* ,*instance-id-3* ``
``Key=tag:my-tag-key ,Values=*my-tag-value-1* ,*my-tag-value-2* ``
``Key=tag-key,Values=*my-tag-key-1* ,*my-tag-key-2* ``
Run Command and Maintenance window targets only : ``Key=resource-groups:Name,Values=*resource-group-name* ``
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*resource-type-1* ,*resource-type-2* ``
Automation targets only : ``Key=ResourceGroup;Values=*resource-group-name* ``
For example:
Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE
Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3
Key=tag-key,Values=Name,Instance-Type,CostCenter
Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.
Maintenance window targets only : ``Key=resource-groups:ResourceTypeFilters,Values=*AWS::EC2::INSTANCE* ,*AWS::EC2::VPC* `` This example demonstrates how to target only EC2 instances and VPCs in your maintenance window.
Automation targets only : Key=ResourceGroup,Values=MyResourceGroup
State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the AWS Region where the association was created.
For more information about how to send commands that target instances using Key,Value parameters, see Targeting multiple instances in the AWS Systems Manager User Guide .
Key (string) --
User-defined criteria for sending commands that target instances that meet the criteria.
Values (list) --
User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .
(string) --
ScheduleExpression (string) --
A cron expression that specifies a schedule when the association runs.
OutputLocation (dict) --
An S3 bucket where you want to store the output details of the request.
S3Location (dict) --
An S3 bucket where you want to store the results of this request.
OutputS3Region (string) --
(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Region of the S3 bucket.
OutputS3BucketName (string) --
The name of the S3 bucket.
OutputS3KeyPrefix (string) --
The S3 bucket subfolder.
LastExecutionDate (datetime) --
The date on which the association was last run.
LastSuccessfulExecutionDate (datetime) --
The last date on which the association was successfully run.
AssociationName (string) --
The association name.
MaxErrors (string) --
The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 instances and set MaxError to 10%, then the system stops sending the request when the sixth error is received.
Executions that are already running an association when MaxErrors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set MaxConcurrency to 1 so that executions proceed one at a time.
MaxConcurrency (string) --
The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.
If a new instance starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new instance will process its association within the limit specified for MaxConcurrency.
ComplianceSeverity (string) --
The severity level that is assigned to the association.
SyncCompliance (string) --
The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .
In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API action. In this case, compliance data is not managed by State Manager. It is managed by your direct call to the PutComplianceItems API action.
By default, all associations use AUTO mode.
ApplyOnlyAtCronInterval (boolean) --
By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter is not supported for rate expressions.
TargetLocations (list) --
The combination of AWS Regions and AWS accounts where you want to run the association.
(dict) --
The combination of AWS Regions and accounts targeted by the current Automation execution.
Accounts (list) --
The AWS accounts targeted by the current Automation execution.
(string) --
Regions (list) --
The AWS Regions targeted by the current Automation execution.
(string) --
TargetLocationMaxConcurrency (string) --
The maximum number of AWS accounts and AWS regions allowed to run the Automation concurrently.
TargetLocationMaxErrors (string) --
The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.
ExecutionRoleName (string) --
The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .
{'DocumentDescription': {'ApprovedVersion': 'string', 'Author': 'string', 'DocumentType': {'Automation.ChangeTemplate'}, 'PendingReviewVersion': 'string', 'ReviewInformation': [{'ReviewedTime': 'timestamp', 'Reviewer': 'string', 'Status': 'APPROVED | ' 'NOT_REVIEWED | ' 'PENDING | ' 'REJECTED'}], 'ReviewStatus': 'APPROVED | NOT_REVIEWED | PENDING | ' 'REJECTED'}}
Updates one or more values for an SSM document.
See also: AWS API Documentation
Request Syntax
client.update_document( Content='string', Attachments=[ { 'Key': 'SourceUrl'|'S3FileUrl'|'AttachmentReference', 'Values': [ 'string', ], 'Name': 'string' }, ], Name='string', VersionName='string', DocumentVersion='string', DocumentFormat='YAML'|'JSON'|'TEXT', TargetType='string' )
string
[REQUIRED]
A valid JSON or YAML string.
list
A list of key and value pairs that describe attachments to a version of a document.
(dict) --
Identifying information about a document attachment, including the file name and a key-value pair that identifies the location of an attachment to a document.
Key (string) --
The key of a key-value pair that identifies the location of an attachment to a document.
Values (list) --
The value of a key-value pair that identifies the location of an attachment to a document. The format for Value depends on the type of key you specify.
For the key SourceUrl , the value is an S3 bucket location. For example: "Values": [ "s3://doc-example-bucket/my-folder" ]
For the key S3FileUrl , the value is a file in an S3 bucket. For example: "Values": [ "s3://doc-example-bucket/my-folder/my-file.py" ]
For the key AttachmentReference , the value is constructed from the name of another SSM document in your account, a version number of that document, and a file attached to that document version that you want to reuse. For example: "Values": [ "MyOtherDocument/3/my-other-file.py" ] However, if the SSM document is shared with you from another account, the full SSM document ARN must be specified instead of the document name only. For example: "Values": [ "arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py" ]
(string) --
Name (string) --
The name of the document attachment file.
string
[REQUIRED]
The name of the document that you want to update.
string
An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.
string
(Required) The latest version of the document that you want to update. The latest document version can be specified using the $LATEST variable or by the version number. Updating a previous version of a document is not supported.
string
Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.
string
Specify a new target type for the document.
dict
Response Syntax
{ 'DocumentDescription': { 'Sha1': 'string', 'Hash': 'string', 'HashType': 'Sha256'|'Sha1', 'Name': 'string', 'VersionName': 'string', 'Owner': 'string', 'CreatedDate': datetime(2015, 1, 1), 'Status': 'Creating'|'Active'|'Updating'|'Deleting'|'Failed', 'StatusInformation': 'string', 'DocumentVersion': 'string', 'Description': 'string', 'Parameters': [ { 'Name': 'string', 'Type': 'String'|'StringList', 'Description': 'string', 'DefaultValue': 'string' }, ], 'PlatformTypes': [ 'Windows'|'Linux', ], 'DocumentType': 'Command'|'Policy'|'Automation'|'Session'|'Package'|'ApplicationConfiguration'|'ApplicationConfigurationSchema'|'DeploymentStrategy'|'ChangeCalendar'|'Automation.ChangeTemplate', 'SchemaVersion': 'string', 'LatestVersion': 'string', 'DefaultVersion': 'string', 'DocumentFormat': 'YAML'|'JSON'|'TEXT', 'TargetType': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AttachmentsInformation': [ { 'Name': 'string' }, ], 'Requires': [ { 'Name': 'string', 'Version': 'string' }, ], 'Author': 'string', 'ReviewInformation': [ { 'ReviewedTime': datetime(2015, 1, 1), 'Status': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED', 'Reviewer': 'string' }, ], 'ApprovedVersion': 'string', 'PendingReviewVersion': 'string', 'ReviewStatus': 'APPROVED'|'NOT_REVIEWED'|'PENDING'|'REJECTED' } }
Response Structure
(dict) --
DocumentDescription (dict) --
A description of the document that was updated.
Sha1 (string) --
The SHA1 hash of the document, which you can use for verification.
Hash (string) --
The Sha256 or Sha1 hash created by the system when the document was created.
Note
Sha1 hashes have been deprecated.
HashType (string) --
The hash type of the document. Valid values include Sha256 or Sha1 .
Note
Sha1 hashes have been deprecated.
Name (string) --
The name of the Systems Manager document.
VersionName (string) --
The version of the artifact associated with the document.
Owner (string) --
The AWS user account that created the document.
CreatedDate (datetime) --
The date when the document was created.
Status (string) --
The status of the Systems Manager document.
StatusInformation (string) --
A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."
DocumentVersion (string) --
The document version.
Description (string) --
A description of the document.
Parameters (list) --
A description of the parameters for a document.
(dict) --
Parameters specified in a System Manager document that run on the server when the command is run.
Name (string) --
The name of the parameter.
Type (string) --
The type of parameter. The type can be either String or StringList.
Description (string) --
A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.
DefaultValue (string) --
If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.
PlatformTypes (list) --
The list of OS platforms compatible with this Systems Manager document.
(string) --
DocumentType (string) --
The type of document.
SchemaVersion (string) --
The schema version.
LatestVersion (string) --
The latest version of the document.
DefaultVersion (string) --
The default version.
DocumentFormat (string) --
The document format, either JSON or YAML.
TargetType (string) --
The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS resource and property types reference in the AWS CloudFormation User Guide .
Tags (list) --
The tags, or metadata, that have been applied to the document.
(dict) --
Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.
Key (string) --
The name of the tag.
Value (string) --
The value of the tag.
AttachmentsInformation (list) --
Details about the document attachments, including names, locations, sizes, and so on.
(dict) --
An attribute of an attachment, such as the attachment name.
Name (string) --
The name of the attachment.
Requires (list) --
A list of SSM documents required by a document. For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema document.
(dict) --
An SSM document required by the current document.
Name (string) --
The name of the required SSM document. The name can be an Amazon Resource Name (ARN).
Version (string) --
The document version required by the current document.
Author (string) --
The user in your organization who created the document.
ReviewInformation (list) --
Details about the review of a document.
(dict) --
Information about the result of a document review request.
ReviewedTime (datetime) --
The time that the reviewer took action on the document review request.
Status (string) --
The current status of the document review request.
Reviewer (string) --
The reviewer assigned to take action on the document review request.
ApprovedVersion (string) --
The version of the document currently approved for use in the organization.
PendingReviewVersion (string) --
The version of the document that is currently under review.
ReviewStatus (string) --
The current status of the review.
{'ActualEndTime': 'timestamp', 'ActualStartTime': 'timestamp', 'PlannedEndTime': 'timestamp', 'PlannedStartTime': 'timestamp', 'Status': {'Approved', 'Cancelled', 'Cancelling', 'ChangeCalendarOverrideApproved', 'ChangeCalendarOverrideRejected', 'CompletedWithFailure', 'CompletedWithSuccess', 'Failed', 'Pending', 'PendingApproval', 'PendingChangeCalendarOverride', 'Rejected', 'RunbookInProgress', 'Scheduled', 'TimedOut'}}
Edit or change an OpsItem. You must have permission in AWS Identity and Access Management (IAM) to update an OpsItem. For more information, see Getting started with OpsCenter in the AWS Systems Manager User Guide .
Operations engineers and IT professionals use OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsCenter in the AWS Systems Manager User Guide .
See also: AWS API Documentation
Request Syntax
client.update_ops_item( Description='string', OperationalData={ 'string': { 'Value': 'string', 'Type': 'SearchableString'|'String' } }, OperationalDataToDelete=[ 'string', ], Notifications=[ { 'Arn': 'string' }, ], Priority=123, RelatedOpsItems=[ { 'OpsItemId': 'string' }, ], Status='Open'|'InProgress'|'Resolved'|'Pending'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'CompletedWithSuccess'|'CompletedWithFailure'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'PendingApproval'|'Approved'|'Rejected', OpsItemId='string', Title='string', Category='string', Severity='string', ActualStartTime=datetime(2015, 1, 1), ActualEndTime=datetime(2015, 1, 1), PlannedStartTime=datetime(2015, 1, 1), PlannedEndTime=datetime(2015, 1, 1) )
string
Update the information about the OpsItem. Provide enough information so that users reading this OpsItem for the first time understand the issue.
dict
Add new keys or edit existing key-value pairs of the OperationalData map in the OpsItem object.
Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.
Warning
Operational data keys can't begin with the following: amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm.
You can choose to make the data searchable by other users in the account or you can restrict search access. Searchable data means that all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. Operational data that is not searchable is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).
Use the /aws/resources key in OperationalData to specify a related resource in the request. Use the /aws/automations key in OperationalData to associate an Automation runbook with the OpsItem. To view AWS CLI example commands that use these keys, see Creating OpsItems manually in the AWS Systems Manager User Guide .
(string) --
(dict) --
An object that defines the value of the key and its type in the OperationalData map.
Value (string) --
The value of the OperationalData key.
Type (string) --
The type of key-value pair. Valid types include SearchableString and String .
list
Keys that you want to remove from the OperationalData map.
(string) --
list
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
(dict) --
A notification about the OpsItem.
Arn (string) --
The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.
integer
The importance of this OpsItem in relation to other OpsItems in the system.
list
One or more OpsItems that share something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
(dict) --
An OpsItems that shares something in common with the current OpsItem. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.
OpsItemId (string) -- [REQUIRED]
The ID of an OpsItem related to the current OpsItem.
string
The OpsItem status. Status can be Open , In Progress , or Resolved . For more information, see Editing OpsItem details in the AWS Systems Manager User Guide .
string
[REQUIRED]
The ID of the OpsItem.
string
A short heading that describes the nature of the OpsItem and the impacted resource.
string
Specify a new category for an OpsItem.
string
Specify a new severity for an OpsItem.
datetime
The time a runbook workflow started. Currently reported only for the OpsItem type /aws/changerequest .
datetime
The time a runbook workflow ended. Currently reported only for the OpsItem type /aws/changerequest .
datetime
The time specified in a change request for a runbook workflow to start. Currently supported only for the OpsItem type /aws/changerequest .
datetime
The time specified in a change request for a runbook workflow to end. Currently supported only for the OpsItem type /aws/changerequest .
dict
Response Syntax
{}
Response Structure
(dict) --