Use ModifyDocumentPermission with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ModifyDocumentPermission with an AWS SDK or CLI

The following code examples show how to use ModifyDocumentPermission.

CLI
AWS 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 AWS 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"