UpdateDocumentDefaultVersion
Set the default version of a document.
Note
If you change a document version for a State Manager association, Systems Manager immediately runs
the association unless you previously specifed the apply-only-at-cron-interval
parameter.
Request Syntax
{
"DocumentVersion": "string
",
"Name": "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.
- DocumentVersion
-
The version of a custom document that you want to set as the default version.
Type: String
Pattern:
(^[1-9][0-9]*$)
Required: Yes
- Name
-
The name of a custom document that you want to set as the default version.
Type: String
Pattern:
^[a-zA-Z0-9_\-.]{3,128}$
Required: Yes
Response Syntax
{
"Description": {
"DefaultVersion": "string",
"DefaultVersionName": "string",
"Name": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Description
-
The description of a custom document that you want to set as the default version.
Type: DocumentDefaultVersionDescription object
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerError
-
An error occurred on the server side.
HTTP Status Code: 500
- InvalidDocument
-
The specified SSM document doesn't exist.
HTTP Status Code: 400
- InvalidDocumentSchemaVersion
-
The version of the document schema isn't supported.
HTTP Status Code: 400
- InvalidDocumentVersion
-
The document version isn't valid or doesn't exist.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of UpdateDocumentDefaultVersion.
Sample Request
POST / HTTP/1.1
Host: ssm.us-east-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonSSM.UpdateDocumentDefaultVersion
Content-Type: application/x-amz-json-1.1
User-Agent: aws-cli/1.17.12 Python/3.6.8 Darwin/18.7.0 botocore/1.14.12
X-Amz-Date: 20240325T183926Z
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240325/us-east-2/ssm/aws4_request,
SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE
Content-Length: 47
{
"Name": "Example",
"DocumentVersion": "2"
}
Sample Response
{
"Description": {
"DefaultVersion": "2",
"Name": "Example"
}
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: