How to Use a Shared Systems Manager Document
When you share a Systems Manager document, the system generates an Amazon Resource Name (ARN) and assigns it to the command. If you select and execute a shared document from the Amazon EC2 console, you do not see the ARN. However, if you want to execute a shared Systems Manager document from a command line application, you must specify a full ARN. You are shown the full ARN for a Systems Manager document when you execute the command to list documents.
Note
You are not required to specify ARNs for AWS public documents (documents that begin with AWS-*) or commands that you own.
This section includes examples of how to view and execute shared Systems Manager documents from the AWS CLI and AWS Tools for Windows PowerShell.
Using a Shared Systems Manager Document from the AWS CLI
To list all public Systems Manager documents
aws ssm list-documents --document-filter-list key=Owner,value=PublicTo list private Systems Manager documents that have been shared with you
aws ssm list-documents --document-filter-list key=Owner,value=PrivateTo list all Systems Manager documents available to you
aws ssm list-documents --document-filter-list key=Owner,value=AllExecute a command from a shared Systems Manager document using a full ARN
aws ssm send-command --document-name FullARN/nameFor example:
aws ssm send-command --document-name arn:aws:ssm:us-east-1:12345678912:document/highAvailabilityServerSetup --instance-ids i-12121212Using a Shared Systems Manager Document from the AWS Tools for Windows PowerShell
To list all public Systems Manager documents
Get-SSMDocumentList -DocumentFilterList @(New-Object Amazon.SimpleSystemsManagement.Model.DocumentFilter("Owner", "Public"))To list private Systems Manager documents that have been shared with you
Get-SSMDocumentList -DocumentFilterList @(New-Object Amazon.SimpleSystemsManagement.Model.DocumentFilter("Owner", "Shared"))To get information about a Systems Manager document that has been shared with you
Get-SSMDocument –Name FullARN/nameFor example:
Get-SSMDocument –Name arn:aws:ssm:us-east-1:12345678912:document/highAvailabilityServerSetupTo get a description of a Systems Manager document that has been shared with you
Get-SSMDocumentDescription –Name FullARN/nameFor example:
Get-SSMDocumentDescription –Name arn:aws:ssm:us-east-1:12345678912:document/highAvailabilityServerSetupTo execute a command from a shared Systems Manager document using a full ARN
Send-SSMCommand –DocumentName FullARN/name –InstanceId IDsFor example:
Send-SSMCommand –DocumentName arn:aws:ssm:us-east-1:555450671542:document/highAvailabilityServerSetup –InstanceId @{"i-273d4e9e"}
