Document

Provides an SSM Document resource

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. To update a document with an older schema version you must recreate the resource.

Permissions

The permissions attribute specifies how you want to share the document. If you share a document privately, 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.

The permissions mapping supports the following:

  • 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.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = new Aws.Ssm.Document("foo", new Aws.Ssm.DocumentArgs
        {
            Content = @"  {
    ""schemaVersion"": ""1.2"",
    ""description"": ""Check ip configuration of a Linux instance."",
    ""parameters"": {

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

",
            DocumentType = "Command",
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ssm"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ssm.NewDocument(ctx, "foo", &ssm.DocumentArgs{
            Content:      pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "  {\n", "    \"schemaVersion\": \"1.2\",\n", "    \"description\": \"Check ip configuration of a Linux instance.\",\n", "    \"parameters\": {\n", "\n", "    },\n", "    \"runtimeConfig\": {\n", "      \"aws:runShellScript\": {\n", "        \"properties\": [\n", "          {\n", "            \"id\": \"0.aws:runShellScript\",\n", "            \"runCommand\": [\"ifconfig\"]\n", "          }\n", "        ]\n", "      }\n", "    }\n", "  }\n", "\n")),
            DocumentType: pulumi.String("Command"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

foo = aws.ssm.Document("foo",
    content="""  {
    "schemaVersion": "1.2",
    "description": "Check ip configuration of a Linux instance.",
    "parameters": {

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

""",
    document_type="Command")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.ssm.Document("foo", {
    content: `  {
    "schemaVersion": "1.2",
    "description": "Check ip configuration of a Linux instance.",
    "parameters": {

    },
    "runtimeConfig": {
      "aws:runShellScript": {
        "properties": [
          {
            "id": "0.aws:runShellScript",
            "runCommand": ["ifconfig"]
          }
        ]
      }
    }
  }
`,
    documentType: "Command",
});

Create a Document Resource

def Document(resource_name, opts=None, attachments_sources=None, content=None, document_format=None, document_type=None, name=None, permissions=None, tags=None, target_type=None, __props__=None);
func NewDocument(ctx *Context, name string, args DocumentArgs, opts ...ResourceOption) (*Document, error)
public Document(string name, DocumentArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DocumentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DocumentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DocumentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Document Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Document resource accepts the following input properties:

Content string

The JSON or YAML content of the document.

DocumentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

AttachmentsSources List<DocumentAttachmentsSourceArgs>

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

DocumentFormat string

The format of the document. Valid document types include: JSON and YAML

Name string

The name of the document.

Permissions Dictionary<string, string>

Additional Permissions to attach to the document. See Permissions below for details.

Tags Dictionary<string, string>

A map of tags to assign to the object.

TargetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

Content string

The JSON or YAML content of the document.

DocumentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

AttachmentsSources []DocumentAttachmentsSource

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

DocumentFormat string

The format of the document. Valid document types include: JSON and YAML

Name string

The name of the document.

Permissions map[string]string

Additional Permissions to attach to the document. See Permissions below for details.

Tags map[string]string

A map of tags to assign to the object.

TargetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

content string

The JSON or YAML content of the document.

documentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

attachmentsSources DocumentAttachmentsSource[]

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

documentFormat string

The format of the document. Valid document types include: JSON and YAML

name string

The name of the document.

permissions {[key: string]: string}

Additional Permissions to attach to the document. See Permissions below for details.

tags {[key: string]: string}

A map of tags to assign to the object.

targetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

content str

The JSON or YAML content of the document.

document_type str

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

attachments_sources List[DocumentAttachmentsSource]

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

document_format str

The format of the document. Valid document types include: JSON and YAML

name str

The name of the document.

permissions Dict[str, str]

Additional Permissions to attach to the document. See Permissions below for details.

tags Dict[str, str]

A map of tags to assign to the object.

target_type str

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

Outputs

All input properties are implicitly available as output properties. Additionally, the Document resource produces the following output properties:

Arn string
CreatedDate string

The date the document was created.

DefaultVersion string

The default version of the document.

Description string

The description of the document.

DocumentVersion string

The document version.

Hash string

The sha1 or sha256 of the document content

HashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

Id string
The provider-assigned unique ID for this managed resource.
LatestVersion string

The latest version of the document.

Owner string

The AWS user account of the person who created the document.

Parameters List<DocumentParameter>

The parameters that are available to this document.

PlatformTypes List<string>

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

SchemaVersion string

The schema version of the document.

Status string

“Creating”, “Active” or “Deleting”. The current status of the document.

Arn string
CreatedDate string

The date the document was created.

DefaultVersion string

The default version of the document.

Description string

The description of the document.

DocumentVersion string

The document version.

Hash string

The sha1 or sha256 of the document content

HashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

Id string
The provider-assigned unique ID for this managed resource.
LatestVersion string

The latest version of the document.

Owner string

The AWS user account of the person who created the document.

Parameters []DocumentParameter

The parameters that are available to this document.

PlatformTypes []string

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

SchemaVersion string

The schema version of the document.

Status string

“Creating”, “Active” or “Deleting”. The current status of the document.

arn string
createdDate string

The date the document was created.

defaultVersion string

The default version of the document.

description string

The description of the document.

documentVersion string

The document version.

hash string

The sha1 or sha256 of the document content

hashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

id string
The provider-assigned unique ID for this managed resource.
latestVersion string

The latest version of the document.

owner string

The AWS user account of the person who created the document.

parameters DocumentParameter[]

The parameters that are available to this document.

platformTypes string[]

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

schemaVersion string

The schema version of the document.

status string

“Creating”, “Active” or “Deleting”. The current status of the document.

arn str
created_date str

The date the document was created.

default_version str

The default version of the document.

description str

The description of the document.

document_version str

The document version.

hash str

The sha1 or sha256 of the document content

hash_type str

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

id str
The provider-assigned unique ID for this managed resource.
latest_version str

The latest version of the document.

owner str

The AWS user account of the person who created the document.

parameters List[DocumentParameter]

The parameters that are available to this document.

platform_types List[str]

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

schema_version str

The schema version of the document.

status str

“Creating”, “Active” or “Deleting”. The current status of the document.

Look up an Existing Document Resource

Get an existing Document resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DocumentState, opts?: CustomResourceOptions): Document
static get(resource_name, id, opts=None, arn=None, attachments_sources=None, content=None, created_date=None, default_version=None, description=None, document_format=None, document_type=None, document_version=None, hash=None, hash_type=None, latest_version=None, name=None, owner=None, parameters=None, permissions=None, platform_types=None, schema_version=None, status=None, tags=None, target_type=None, __props__=None);
func GetDocument(ctx *Context, name string, id IDInput, state *DocumentState, opts ...ResourceOption) (*Document, error)
public static Document Get(string name, Input<string> id, DocumentState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string
AttachmentsSources List<DocumentAttachmentsSourceArgs>

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

Content string

The JSON or YAML content of the document.

CreatedDate string

The date the document was created.

DefaultVersion string

The default version of the document.

Description string

The description of the document.

DocumentFormat string

The format of the document. Valid document types include: JSON and YAML

DocumentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

DocumentVersion string

The document version.

Hash string

The sha1 or sha256 of the document content

HashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

LatestVersion string

The latest version of the document.

Name string

The name of the document.

Owner string

The AWS user account of the person who created the document.

Parameters List<DocumentParameterArgs>

The parameters that are available to this document.

Permissions Dictionary<string, string>

Additional Permissions to attach to the document. See Permissions below for details.

PlatformTypes List<string>

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

SchemaVersion string

The schema version of the document.

Status string

“Creating”, “Active” or “Deleting”. The current status of the document.

Tags Dictionary<string, string>

A map of tags to assign to the object.

TargetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

Arn string
AttachmentsSources []DocumentAttachmentsSource

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

Content string

The JSON or YAML content of the document.

CreatedDate string

The date the document was created.

DefaultVersion string

The default version of the document.

Description string

The description of the document.

DocumentFormat string

The format of the document. Valid document types include: JSON and YAML

DocumentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

DocumentVersion string

The document version.

Hash string

The sha1 or sha256 of the document content

HashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

LatestVersion string

The latest version of the document.

Name string

The name of the document.

Owner string

The AWS user account of the person who created the document.

Parameters []DocumentParameter

The parameters that are available to this document.

Permissions map[string]string

Additional Permissions to attach to the document. See Permissions below for details.

PlatformTypes []string

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

SchemaVersion string

The schema version of the document.

Status string

“Creating”, “Active” or “Deleting”. The current status of the document.

Tags map[string]string

A map of tags to assign to the object.

TargetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

arn string
attachmentsSources DocumentAttachmentsSource[]

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

content string

The JSON or YAML content of the document.

createdDate string

The date the document was created.

defaultVersion string

The default version of the document.

description string

The description of the document.

documentFormat string

The format of the document. Valid document types include: JSON and YAML

documentType string

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

documentVersion string

The document version.

hash string

The sha1 or sha256 of the document content

hashType string

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

latestVersion string

The latest version of the document.

name string

The name of the document.

owner string

The AWS user account of the person who created the document.

parameters DocumentParameter[]

The parameters that are available to this document.

permissions {[key: string]: string}

Additional Permissions to attach to the document. See Permissions below for details.

platformTypes string[]

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

schemaVersion string

The schema version of the document.

status string

“Creating”, “Active” or “Deleting”. The current status of the document.

tags {[key: string]: string}

A map of tags to assign to the object.

targetType string

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

arn str
attachments_sources List[DocumentAttachmentsSource]

One or more configuration blocks describing attachments sources to a version of a document. Defined below.

content str

The JSON or YAML content of the document.

created_date str

The date the document was created.

default_version str

The default version of the document.

description str

The description of the document.

document_format str

The format of the document. Valid document types include: JSON and YAML

document_type str

The type of the document. Valid document types include: Automation, Command, Package, Policy, and Session

document_version str

The document version.

hash str

The sha1 or sha256 of the document content

hash_type str

“Sha1” “Sha256”. The hashing algorithm used when hashing the content.

latest_version str

The latest version of the document.

name str

The name of the document.

owner str

The AWS user account of the person who created the document.

parameters List[DocumentParameter]

The parameters that are available to this document.

permissions Dict[str, str]

Additional Permissions to attach to the document. See Permissions below for details.

platform_types List[str]

A list of OS platforms compatible with this SSM document, either “Windows” or “Linux”.

schema_version str

The schema version of the document.

status str

“Creating”, “Active” or “Deleting”. The current status of the document.

tags Dict[str, str]

A map of tags to assign to the object.

target_type str

The target type which defines the kinds of resources the document can run on. For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS Resource Types Reference (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)

Supporting Types

DocumentAttachmentsSource

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

The key describing the location of an attachment to a document. Valid key types include: SourceUrl and S3FileUrl

Values List<string>

The value describing the location of an attachment to a document

Name string

The name of the document attachment file

Key string

The key describing the location of an attachment to a document. Valid key types include: SourceUrl and S3FileUrl

Values []string

The value describing the location of an attachment to a document

Name string

The name of the document attachment file

key string

The key describing the location of an attachment to a document. Valid key types include: SourceUrl and S3FileUrl

values string[]

The value describing the location of an attachment to a document

name string

The name of the document attachment file

key str

The key describing the location of an attachment to a document. Valid key types include: SourceUrl and S3FileUrl

values List[str]

The value describing the location of an attachment to a document

name str

The name of the document attachment file

DocumentParameter

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DefaultValue string
Description string

The description of the document.

Name string

The name of the document.

Type string
DefaultValue string
Description string

The description of the document.

Name string

The name of the document.

Type string
defaultValue string
description string

The description of the document.

name string

The name of the document.

type string
default_value str
description str

The description of the document.

name str

The name of the document.

type str

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.