From 3a52453e05bc47feb8d56a9649496cb1e1dc9375 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 29 Nov 2017 11:22:43 +1300 Subject: [PATCH] Test that targets are well set in the state --- aws/resource_aws_ssm_association_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_ssm_association_test.go b/aws/resource_aws_ssm_association_test.go index a613e03df51..4186e29e456 100644 --- a/aws/resource_aws_ssm_association_test.go +++ b/aws/resource_aws_ssm_association_test.go @@ -40,6 +40,10 @@ func TestAccAWSSSMAssociation_withTargets(t *testing.T) { Config: testAccAWSSSMAssociationBasicConfigWithTargets(name), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMAssociationExists("aws_ssm_association.foo"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.0.key", "tag:Name"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.0.values.0", "acceptanceTest"), ), }, }, @@ -57,6 +61,14 @@ func TestAccAWSSSMAssociation_withMultipleTargets(t *testing.T) { Config: testAccAWSSSMAssociationBasicConfigWithMultipleTargets(name), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMAssociationExists("aws_ssm_association.foo"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.0.key", "tag:Name"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.0.values.0", "acceptanceTest"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.1.key", "tag:Environment"), + resource.TestCheckResourceAttr( + "aws_ssm_association.foo", "targets.1.values.0", "acceptanceTest"), ), }, },