2016-08-25 10:47:24 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_ssm_document"
|
|
|
|
sidebar_current: "docs-aws-resource-ssm-document"
|
|
|
|
description: |-
|
|
|
|
Provides an SSM Document resource
|
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_ssm\_document
|
|
|
|
|
|
|
|
Provides an SSM Document resource
|
|
|
|
|
2017-04-10 13:13:43 +02:00
|
|
|
~> **NOTE on updating SSM documents:** Only documents with a schema version of 2.0
|
|
|
|
or greater can update their content once created, see [SSM Schema Features][1]. To update a document with an older
|
|
|
|
schema version you must recreate the resource.
|
|
|
|
|
2016-08-25 10:47:24 +02:00
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_ssm_document" "foo" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test_document"
|
2017-02-08 13:45:38 +01:00
|
|
|
document_type = "Command"
|
2017-02-18 23:48:50 +01:00
|
|
|
|
2016-08-25 10:47:24 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) The name of the document.
|
|
|
|
* `content` - (Required) The json content of the document.
|
2017-02-08 13:45:38 +01:00
|
|
|
* `document_type` - (Required) The type of the document. Valid document types include: `Command`, `Policy` and `Automation`
|
2017-02-25 04:42:43 +01:00
|
|
|
* `permissions` - (Optional) Additional Permissions to attach to the document. See [Permissions](#permissions) below for details.
|
2016-08-25 10:47:24 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
2017-02-08 13:45:38 +01:00
|
|
|
* `name` - The name of the document.
|
|
|
|
* `content` - The json content of the document.
|
|
|
|
* `created_date` - The date the document was created.
|
|
|
|
* `description` - The description of the document.
|
2017-04-10 13:13:43 +02:00
|
|
|
* `schema_version` - The schema version of the document.
|
2017-02-08 13:45:38 +01:00
|
|
|
* `document_type` - The type of document created.
|
|
|
|
* `default_version` - The default version of the document.
|
2016-08-25 10:47:24 +02:00
|
|
|
* `hash` - The sha1 or sha256 of the document content
|
|
|
|
* `hash_type` - "Sha1" "Sha256". The hashing algorithm used when hashing the content.
|
2017-02-08 13:45:38 +01:00
|
|
|
* `latest_version` - The latest version of the document.
|
2016-08-25 10:47:24 +02:00
|
|
|
* `owner` - The AWS user account of the person who created the document.
|
|
|
|
* `status` - "Creating", "Active" or "Deleting". The current status of the document.
|
|
|
|
* `parameter` - The parameters that are available to this document.
|
2017-02-25 04:42:43 +01:00
|
|
|
* `permissions` - The permissions of how this document should be shared.
|
2017-02-08 13:45:38 +01:00
|
|
|
* `platform_types` - A list of OS platforms compatible with this SSM document, either "Windows" or "Linux".
|
2016-08-25 10:47:24 +02:00
|
|
|
|
2017-04-10 13:13:43 +02:00
|
|
|
[1]: http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html#document-schemas-features
|
|
|
|
|
2016-08-25 10:47:24 +02:00
|
|
|
## Permissions
|
|
|
|
|
2017-02-25 04:42:43 +01:00
|
|
|
The permissions attribute specifies how you want to share the document. If you share a document privately,
|
2016-08-25 10:47:24 +02:00
|
|
|
you must specify the AWS user account IDs for those people who can use the document. If you share a document
|
|
|
|
publicly, you must specify All as the account ID.
|
|
|
|
|
2017-02-25 04:42:43 +01:00
|
|
|
The permissions mapping supports the following:
|
2016-08-25 10:47:24 +02:00
|
|
|
|
|
|
|
* `type` - The permission type for the document. The permission type can be `Share`.
|
|
|
|
* `account_ids` - The AWS user accounts that should have access to the document. The account IDs can either be a group of account IDs or `All`.
|