- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateDocumentDefaultVersionCommand
Set the default version of a document.
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.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SSMClient, UpdateDocumentDefaultVersionCommand } from "@aws-sdk/client-ssm"; // ES Modules import
// const { SSMClient, UpdateDocumentDefaultVersionCommand } = require("@aws-sdk/client-ssm"); // CommonJS import
const client = new SSMClient(config);
const input = { // UpdateDocumentDefaultVersionRequest
Name: "STRING_VALUE", // required
DocumentVersion: "STRING_VALUE", // required
};
const command = new UpdateDocumentDefaultVersionCommand(input);
const response = await client.send(command);
// { // UpdateDocumentDefaultVersionResult
// Description: { // DocumentDefaultVersionDescription
// Name: "STRING_VALUE",
// DefaultVersion: "STRING_VALUE",
// DefaultVersionName: "STRING_VALUE",
// },
// };
UpdateDocumentDefaultVersionCommand Input
See UpdateDocumentDefaultVersionCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DocumentVersion Required | string | undefined | The version of a custom document that you want to set as the default version. |
Name Required | string | undefined | The name of a custom document that you want to set as the default version. |
UpdateDocumentDefaultVersionCommand Output
See UpdateDocumentDefaultVersionCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Description | DocumentDefaultVersionDescription | undefined | The description of a custom document that you want to set as the default version. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerError | server | An error occurred on the server side. |
InvalidDocument | client | The specified SSM document doesn't exist. |
InvalidDocumentSchemaVersion | client | The version of the document schema isn't supported. |
InvalidDocumentVersion | client | The document version isn't valid or doesn't exist. |
SSMServiceException | Base exception class for all service exceptions from SSM service. |