github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/ssm_association.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ssm_association"
     4  sidebar_current: "docs-aws-resource-ssm-association"
     5  description: |-
     6    Assosciates an SSM Document to an instance.
     7  ---
     8  
     9  # aws\_ssm\_association
    10  
    11  Assosciates an SSM Document to an instance.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_security_group" "tf_test_foo" {
    17    name = "tf_test_foo"
    18    description = "foo"
    19    ingress {
    20      protocol = "icmp"
    21      from_port = -1
    22      to_port = -1
    23      cidr_blocks = ["0.0.0.0/0"]
    24    }
    25  }
    26  
    27  resource "aws_instance" "foo" {
    28    # eu-west-1
    29    ami = "ami-f77ac884"
    30    availability_zone = "eu-west-1a"
    31    instance_type = "t2.small"
    32    security_groups = ["${aws_security_group.tf_test_foo.name}"]
    33  }
    34  
    35  resource "aws_ssm_document" "foo_document" {
    36    name    = "test_document_association-%s",
    37    content = <<DOC
    38    {
    39      "schemaVersion": "1.2",
    40      "description": "Check ip configuration of a Linux instance.",
    41      "parameters": {
    42  
    43      },
    44      "runtimeConfig": {
    45        "aws:runShellScript": {
    46          "properties": [
    47            {
    48              "id": "0.aws:runShellScript",
    49              "runCommand": ["ifconfig"]
    50            }
    51          ]
    52        }
    53      }
    54    }
    55  DOC
    56  }
    57  
    58  resource "aws_ssm_association" "foo" {
    59    name        = "test_document_association-%s",
    60    instance_id = "${aws_instance.foo.id}"
    61  }
    62  
    63  ```
    64  
    65  ## Argument Reference
    66  
    67  The following arguments are supported:
    68  
    69  * `name` - (Required) The name of the SSM document to apply.
    70  * `instance_id` - (Required) The instance id to apply an SSM document to.
    71  * `parameters` - (Optional) Additional parameters to pass to the SSM document.
    72  
    73  ## Attributes Reference
    74  
    75  The following attributes are exported:
    76  
    77  * `name` - The name of the SSM document to apply.
    78  * `instance_ids` - The instance id that the SSM document was applied to.
    79  * `parameters` - Additional parameters passed to the SSM document.