From 042948ba6b95790ca2da982be75ac94b3d24e3d9 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Fri, 14 Aug 2020 08:13:08 +0900 Subject: [PATCH] r/aws_organizations_organization: Add support for AISERVICES_OPT_OUT_POLICY --- aws/resource_aws_organizations_organization.go | 1 + aws/resource_aws_organizations_organization_test.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/aws/resource_aws_organizations_organization.go b/aws/resource_aws_organizations_organization.go index 465e9ade23b..8e832f60b4b 100644 --- a/aws/resource_aws_organizations_organization.go +++ b/aws/resource_aws_organizations_organization.go @@ -144,6 +144,7 @@ func resourceAwsOrganizationsOrganization() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringInSlice([]string{ + organizations.PolicyTypeAiservicesOptOutPolicy, organizations.PolicyTypeBackupPolicy, organizations.PolicyTypeServiceControlPolicy, organizations.PolicyTypeTagPolicy, diff --git a/aws/resource_aws_organizations_organization_test.go b/aws/resource_aws_organizations_organization_test.go index 12ba987ecc0..6a02c6688ef 100644 --- a/aws/resource_aws_organizations_organization_test.go +++ b/aws/resource_aws_organizations_organization_test.go @@ -109,6 +109,7 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", organizations.PolicyTypeServiceControlPolicy), ), }, { @@ -123,11 +124,20 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "0"), ), }, + { + Config: testAccAwsOrganizationsOrganizationConfigEnabledPolicyTypes1(organizations.PolicyTypeAiservicesOptOutPolicy), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", organizations.PolicyTypeAiservicesOptOutPolicy), + ), + }, { Config: testAccAwsOrganizationsOrganizationConfigEnabledPolicyTypes1(organizations.PolicyTypeServiceControlPolicy), Check: resource.ComposeTestCheckFunc( testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", organizations.PolicyTypeServiceControlPolicy), ), }, { @@ -135,6 +145,7 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", organizations.PolicyTypeBackupPolicy), ), }, { @@ -142,6 +153,7 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", organizations.PolicyTypeTagPolicy), ), }, {