Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

ModifyDocumentPermission

Shares a Systems Manager document publicly or privately. If you share a document privately, you must specify the AWS user account IDs for those people who can use the document. If you share a document publicly, you must specify All as the account ID.

Request Syntax

{
   "AccountIdsToAdd": [ "string" ],
   "AccountIdsToRemove": [ "string" ],
   "Name": "string",
   "PermissionType": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AccountIdsToAdd

The AWS user accounts that should have access to the document. The account IDs can either be a group of account IDs or All.

Type: Array of strings

Array Members: Maximum number of 20 items.

Pattern: (?i)all|[0-9]{12}

Required: No

AccountIdsToRemove

The AWS user accounts that should no longer have access to the document. The AWS user account can either be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify an account ID to add and the same ID to remove, the system removes access to the document.

Type: Array of strings

Array Members: Maximum number of 20 items.

Pattern: (?i)all|[0-9]{12}

Required: No

Name

The name of the document that you want to share.

Type: String

Pattern: ^[a-zA-Z0-9_\-.]{3,128}$

Required: Yes

PermissionType

The permission type for the document. The permission type can be Share.

Type: String

Valid Values: Share

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

DocumentLimitExceeded

You can have at most 200 active Systems Manager documents.

HTTP Status Code: 400

DocumentPermissionLimit

The document cannot be shared with more AWS user accounts. You can share a document with a maximum of 20 accounts. You can publicly share up to five documents. If you need to increase this limit, contact AWS Support.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

InvalidDocument

The specified document does not exist.

HTTP Status Code: 400

InvalidPermissionType

The permission type is not supported. Share is the only supported permission type.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: