Skip to content

Data Source: awsSsmDocument

Gets the contents of the specified Systems Manager document.

Example Usage

To get the contents of the document owned by AWS.

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsSsmDocumentFoo = new aws.dataAwsSsmDocument.DataAwsSsmDocument(
  this,
  "foo",
  {
    documentFormat: "YAML",
    name: "AWS-GatherSoftwareInventory",
  }
);
new cdktf.TerraformOutput(this, "content", {
  value: dataAwsSsmDocumentFoo.content,
});

To get the contents of the custom document.

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsSsmDocument.DataAwsSsmDocument(this, "test", {
  documentFormat: "JSON",
  name: "${aws_ssm_document.test.name}",
});

Argument Reference

The following arguments are supported:

  • name - (Required) Name of the Systems Manager document.
  • documentFormat - (Optional) Returns the document in the specified format. The document format can be either json, yaml and text. JSON is the default format.
  • documentVersion - (Optional) Document version for which you want information.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the document. If the document is an AWS managed document, this value will be set to the name of the document instead.
  • content - Contents of the document.
  • documentType - Type of the document.