awscc_ssm_document (Resource)

The AWS::SSM::Document resource is an SSM document in AWS Systems Manager that defines the actions that Systems Manager performs, which can be used to set up and run commands on your instances.

Example Usage

Create an SSM document in JSON format

resource "awscc_ssm_document" "example" {
  name          = "example_document"
  document_type = "Command"

  content = <<DOC
  {
    "schemaVersion": "1.2",
    "description": "Check ip configuration of a Linux instance.",
    "parameters": {

    },
    "runtimeConfig": {
      "aws:runShellScript": {
        "properties": [
          {
            "id": "0.aws:runShellScript",
            "runCommand": ["ifconfig"]
          }
        ]
      }
    }
  }
DOC

  tags = [{
    key   = "Modified By"
    value = "AWSCC"
  }]

}

Create an SSM document in YAML format

resource "aws_ssm_document" "foo" {
  name            = "test_document"
  document_format = "YAML"
  document_type   = "Command"

  content = <<DOC
schemaVersion: '1.2'
description: Check ip configuration of a Linux instance.
parameters: {}
runtimeConfig:
  'aws:runShellScript':
    properties:
      - id: '0.aws:runShellScript'
        runCommand:
          - ifconfig
DOC
}

Schema

Required

Optional

Read-Only

Nested Schema for attachments

Optional:

Nested Schema for requires

Optional:

Nested Schema for tags

Optional:

Import

Import is supported using the following syntax:

$ terraform import awscc_ssm_document.example <resource ID>