Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ssm ]

get-document

Description

Gets the contents of the specified Systems Manager document.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  get-document
--name <value>
[--version-name <value>]
[--document-version <value>]
[--document-format <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--name (string)

The name of the Systems Manager document.

--version-name (string)

An optional field specifying the version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.

--document-version (string)

The document version for which you want information.

--document-format (string)

Returns the document in the specified format. The document format can be either JSON or YAML. JSON is the default format.

Possible values:

  • YAML
  • JSON

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To get the contents of a document

This example returns the content of a document.

Command:

aws ssm get-document --name "RunShellScript"

Output:

{
  "Content": "{\n   \"schemaVersion\":\"2.0\",\n   \"description\":\"Run a script\",\n   \"parameters\":{\n      \"commands\":{\n         \"type\":\"StringList\",\n         \"description\":\"(Required) Specify a shell script or a command to run.\",\n         \"minItems\":1,\n         \"displayType\":\"textarea\"\n      }\n   },\n   \"mainSteps\":[\n      {\n         \"action\":\"aws:runShellScript\",\n         \"name\":\"runShellScript\",\n         \"inputs\":{\n            \"commands\":\"{{ commands }}\"\n         }\n      },\n      {\n         \"action\":\"aws:runPowerShellScript\",\n         \"name\":\"runPowerShellScript\",\n         \"inputs\":{\n            \"commands\":\"{{ commands }}\"\n         }\n      }\n   ]\n}\n",
  "Name": "RunShellScript.json",
  "DocumentVersion": "1",
  "DocumentType": "Command"
}

Output

Name -> (string)

The name of the Systems Manager document.

VersionName -> (string)

The version of the artifact associated with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and cannot be changed.

DocumentVersion -> (string)

The document version.

Status -> (string)

The status of the Systems Manager document, such as Creating , Active , Updating , Failed , and Deleting .

StatusInformation -> (string)

A message returned by AWS Systems Manager that explains the Status value. For example, a Failed status might be explained by the StatusInformation message, "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is correct."

Content -> (string)

The contents of the Systems Manager document.

DocumentType -> (string)

The document type.

DocumentFormat -> (string)

The document format, either JSON or YAML.

AttachmentsContent -> (list)

A description of the document attachments, including names, locations, sizes, etc.

(structure)

A structure that includes attributes that describe a document attachment.

Name -> (string)

The name of an attachment.

Size -> (long)

The size of an attachment in bytes.

Hash -> (string)

The cryptographic hash value of the document content.

HashType -> (string)

The hash algorithm used to calculate the hash value.

Url -> (string)

The URL location of the attachment content.