From ff59f5e162b20dfb323350f264fb6324dde4471b Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 24 Apr 2018 09:21:57 -0400 Subject: [PATCH 1/2] docs/resource/aws_ssm_association: Prefer targets InstanceIds over instance_id for schema version 2.0+ --- website/docs/r/ssm_association.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/docs/r/ssm_association.html.markdown b/website/docs/r/ssm_association.html.markdown index 0b96e8d4ad47..4ed9898c409a 100644 --- a/website/docs/r/ssm_association.html.markdown +++ b/website/docs/r/ssm_association.html.markdown @@ -60,7 +60,10 @@ DOC resource "aws_ssm_association" "foo" { name = "test_document_association-%s" - instance_id = "${aws_instance.foo.id}" + targets { + key = "InstanceIds" + values = "${aws_instance.foo.id}" + } } ``` @@ -71,7 +74,7 @@ The following arguments are supported: * `name` - (Required) The name of the SSM document to apply. * `association_name` - (Optional) The descriptive name for the association. * `document_version` - (Optional) The document version you want to associate with the target(s). Can be a specific version or the default version. -* `instance_id` - (Optional) The instance ID to apply an SSM document to. +* `instance_id` - (Optional) The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. * `output_location` - (Optional) An output location block. Output Location is documented below. * `parameters` - (Optional) A block of arbitrary string parameters to pass to the SSM document. * `schedule_expression` - (Optional) A cron expression when the association will be applied to the target(s). From bafcaed7f9b16f93aa67b4191aa15a3a1fa490ff Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 24 Apr 2018 10:09:50 -0400 Subject: [PATCH 2/2] docs/resource/aws_ssm_association: Remove extraneous example resources and just provide fake example references --- website/docs/r/ssm_association.html.markdown | 50 ++------------------ 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/website/docs/r/ssm_association.html.markdown b/website/docs/r/ssm_association.html.markdown index 4ed9898c409a..05aff7a8c3ca 100644 --- a/website/docs/r/ssm_association.html.markdown +++ b/website/docs/r/ssm_association.html.markdown @@ -13,56 +13,12 @@ Associates an SSM Document to an instance or EC2 tag. ## Example Usage ```hcl -resource "aws_security_group" "tf_test_foo" { - name = "tf_test_foo" - description = "foo" +resource "aws_ssm_association" "example" { + name = "${aws_ssm_document.example.name}" - ingress { - protocol = "icmp" - from_port = -1 - to_port = -1 - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_instance" "foo" { - # eu-west-1 - ami = "ami-f77ac884" - availability_zone = "eu-west-1a" - instance_type = "t2.small" - security_groups = ["${aws_security_group.tf_test_foo.name}"] -} - -resource "aws_ssm_document" "foo_document" { - name = "test_document_association-%s" - document_type = "Command" - - content = <