github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 20 ingress { 21 protocol = "icmp" 22 from_port = -1 23 to_port = -1 24 cidr_blocks = ["0.0.0.0/0"] 25 } 26 } 27 28 resource "aws_instance" "foo" { 29 # eu-west-1 30 ami = "ami-f77ac884" 31 availability_zone = "eu-west-1a" 32 instance_type = "t2.small" 33 security_groups = ["${aws_security_group.tf_test_foo.name}"] 34 } 35 36 resource "aws_ssm_document" "foo_document" { 37 name = "test_document_association-%s" 38 39 content = <<DOC 40 { 41 "schemaVersion": "1.2", 42 "description": "Check ip configuration of a Linux instance.", 43 "parameters": { 44 45 }, 46 "runtimeConfig": { 47 "aws:runShellScript": { 48 "properties": [ 49 { 50 "id": "0.aws:runShellScript", 51 "runCommand": ["ifconfig"] 52 } 53 ] 54 } 55 } 56 } 57 DOC 58 } 59 60 resource "aws_ssm_association" "foo" { 61 name = "test_document_association-%s" 62 instance_id = "${aws_instance.foo.id}" 63 } 64 ``` 65 66 ## Argument Reference 67 68 The following arguments are supported: 69 70 * `name` - (Required) The name of the SSM document to apply. 71 * `instance_id` - (Required) The instance id to apply an SSM document to. 72 * `parameters` - (Optional) Additional parameters to pass to the SSM document. 73 74 ## Attributes Reference 75 76 The following attributes are exported: 77 78 * `name` - The name of the SSM document to apply. 79 * `instance_ids` - The instance id that the SSM document was applied to. 80 * `parameters` - Additional parameters passed to the SSM document.