Use ModifyDocumentPermission with an Amazon SDK or CLI - Amazon Systems Manager
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use ModifyDocumentPermission with an Amazon SDK or CLI

The following code examples show how to use ModifyDocumentPermission.

CLI
Amazon CLI

To modify document permissions

The following modify-document-permission example shares a Systems Manager document publicly.

aws ssm modify-document-permission \ --name "Example" \ --permission-type "Share" \ --account-ids-to-add "All"

This command produces no output.

For more information, see Share a Systems Manager Document in the Amazon Systems Manager User Guide.

PowerShell
Tools for PowerShell

Example 1: This example adds "share" permissions to all accounts for a document. There is no output if the command succeeds.

Edit-SSMDocumentPermission -Name "RunShellScript" -PermissionType "Share" -AccountIdsToAdd all

Example 2: This example adds "share" permissions to a specific account for a document. There is no output if the command succeeds.

Edit-SSMDocumentPermission -Name "RunShellScriptNew" -PermissionType "Share" -AccountIdsToAdd "123456789012"

For a complete list of Amazon SDK developer guides and code examples, see Using Systems Manager with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.