From be970105c210223772fcd7f93fa6942c2d274845 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 27 Aug 2020 20:39:01 -0400 Subject: [PATCH 1/3] add diffsupressfunc for json field --- aws/resource_aws_opsworks_stack.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_opsworks_stack.go b/aws/resource_aws_opsworks_stack.go index 4f918b6021b..28af6248ac5 100644 --- a/aws/resource_aws_opsworks_stack.go +++ b/aws/resource_aws_opsworks_stack.go @@ -131,8 +131,9 @@ func resourceAwsOpsworksStack() *schema.Resource { }, "custom_json": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + DiffSuppressFunc: suppressEquivalentJsonDiffs, }, "default_availability_zone": { From db4b17448097b1aada885d04bfca6f0998318444 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 27 Aug 2020 22:37:20 -0400 Subject: [PATCH 2/3] refactor opsworks_slack tests and update enumerated values --- aws/resource_aws_opsworks_application.go | 26 +- aws/resource_aws_opsworks_instance.go | 46 ++-- aws/resource_aws_opsworks_stack_test.go | 327 ++++------------------- 3 files changed, 79 insertions(+), 320 deletions(-) diff --git a/aws/resource_aws_opsworks_application.go b/aws/resource_aws_opsworks_application.go index eda091b5beb..b502b67ce84 100644 --- a/aws/resource_aws_opsworks_application.go +++ b/aws/resource_aws_opsworks_application.go @@ -34,17 +34,9 @@ func resourceAwsOpsworksApplication() *schema.Resource { ForceNew: true, }, "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - opsworks.AppTypeAwsFlowRuby, - opsworks.AppTypeJava, - opsworks.AppTypeRails, - opsworks.AppTypePhp, - opsworks.AppTypeNodejs, - opsworks.AppTypeStatic, - opsworks.AppTypeOther, - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(opsworks.AppType_Values(), false), }, "stack_id": { Type: schema.TypeString, @@ -77,15 +69,9 @@ func resourceAwsOpsworksApplication() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - opsworks.SourceTypeGit, - opsworks.SourceTypeSvn, - opsworks.SourceTypeArchive, - opsworks.SourceTypeS3, - "other", - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(opsworks.SourceType_Values(), false), }, "url": { diff --git a/aws/resource_aws_opsworks_instance.go b/aws/resource_aws_opsworks_instance.go index 17ef4b3319a..82fb74d455e 100644 --- a/aws/resource_aws_opsworks_instance.go +++ b/aws/resource_aws_opsworks_instance.go @@ -46,22 +46,16 @@ func resourceAwsOpsworksInstance() *schema.Resource { }, "architecture": { - Type: schema.TypeString, - Optional: true, - Default: "x86_64", - ValidateFunc: validation.StringInSlice([]string{ - opsworks.ArchitectureX8664, - opsworks.ArchitectureI386, - }, false), + Type: schema.TypeString, + Optional: true, + Default: "x86_64", + ValidateFunc: validation.StringInSlice(opsworks.Architecture_Values(), false), }, "auto_scaling_type": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - opsworks.AutoScalingTypeLoad, - opsworks.AutoScalingTypeTimer, - }, false), + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice(opsworks.AutoScalingType_Values(), false), }, "availability_zone": { @@ -223,14 +217,11 @@ func resourceAwsOpsworksInstance() *schema.Resource { }, "root_device_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - opsworks.RootDeviceTypeEbs, - opsworks.RootDeviceTypeInstanceStore, - }, false), + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ValidateFunc: validation.StringInSlice(opsworks.RootDeviceType_Values(), false), }, "root_device_volume_id": { @@ -305,14 +296,11 @@ func resourceAwsOpsworksInstance() *schema.Resource { }, "virtualization_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - opsworks.VirtualizationTypeParavirtual, - opsworks.VirtualizationTypeHvm, - }, false), + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(opsworks.VirtualizationType_Values(), false), }, "ebs_block_device": { diff --git a/aws/resource_aws_opsworks_stack_test.go b/aws/resource_aws_opsworks_stack_test.go index 1df7486d1c0..8ddf04b1500 100644 --- a/aws/resource_aws_opsworks_stack_test.go +++ b/aws/resource_aws_opsworks_stack_test.go @@ -31,8 +31,7 @@ func TestAccAWSOpsworksStack_noVpcBasic(t *testing.T) { Config: testAccAwsOpsworksStackConfigNoVpcCreate(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSOpsworksStackExists(resourceName, false, &opsstack), - testAccCheckAWSOpsworksCreateStackAttributes(&opsstack, "us-east-1a", stackName), - testAccAwsOpsworksStackCheckResourceAttrsCreate("us-east-1a", stackName), + testAccCheckAWSOpsworksCreateStackAttributes("us-east-1a", stackName), ), }, { @@ -90,8 +89,7 @@ func TestAccAWSOpsworksStack_vpc(t *testing.T) { Config: testAccAwsOpsworksStackConfigVpcCreate(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSOpsworksStackExists(resourceName, true, &opsstack), - testAccCheckAWSOpsworksCreateStackAttributes(&opsstack, "us-west-2a", stackName), - testAccAwsOpsworksStackCheckResourceAttrsCreate("us-west-2a", stackName), + testAccCheckAWSOpsworksCreateStackAttributes("us-west-2a", stackName), ), }, { @@ -103,8 +101,18 @@ func TestAccAWSOpsworksStack_vpc(t *testing.T) { Config: testAccAWSOpsworksStackConfigVpcUpdate(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSOpsworksStackExists(resourceName, true, &opsstack), - testAccCheckAWSOpsworksUpdateStackAttributes(&opsstack, "us-west-2a", stackName), - testAccAwsOpsworksStackCheckResourceAttrsUpdate("us-west-2a", stackName), + resource.TestCheckResourceAttr(resourceName, "name", stackName), + resource.TestCheckResourceAttr(resourceName, "default_availability_zone", "us-west-2a"), + resource.TestCheckResourceAttr(resourceName, "default_os", "Amazon Linux 2015.09"), + resource.TestCheckResourceAttr(resourceName, "default_root_device_type", "ebs"), + resource.TestCheckResourceAttr(resourceName, "custom_json", customJson), + resource.TestCheckResourceAttr(resourceName, "configuration_manager_version", "11.10"), + resource.TestCheckResourceAttr(resourceName, "use_opsworks_security_groups", "false"), + resource.TestCheckResourceAttr(resourceName, "use_custom_cookbooks", "true"), + resource.TestCheckResourceAttr(resourceName, "manage_berkshelf", "true"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.type", "git"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.revision", "master"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.url", "https://github.com/aws/opsworks-example-cookbooks.git"), ), }, }, @@ -151,8 +159,10 @@ func TestAccAWSOpsworksStack_noVpcCreateTags(t *testing.T) { ///////////////////////////// func TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties(t *testing.T) { + resourceName := "aws_opsworks_stack.tf-acc" stackName := fmt.Sprintf("tf-opsworks-acc-%d", acctest.RandInt()) var opsstack opsworks.Stack + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -161,16 +171,21 @@ func TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties(t *testing.T) { Config: testAccAWSOpsworksStackConfig_CustomCookbooks_Set(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSOpsworksStackExists("aws_opsworks_stack.tf-acc", true, &opsstack), - testAccCheckAWSOpsworksCreateStackAttributesWithCookbooks(&opsstack, "us-west-2a", stackName), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_cookbooks_source.0.password", - "password"), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_cookbooks_source.0.ssh_key", - sshKey), + testAccCheckAWSOpsworksStackExists(resourceName, true, &opsstack), + resource.TestCheckResourceAttr(resourceName, "name", stackName), + resource.TestCheckResourceAttr(resourceName, "default_availability_zone", "us-west-2a"), + resource.TestCheckResourceAttr(resourceName, "default_os", "Amazon Linux 2016.09"), + resource.TestCheckResourceAttr(resourceName, "default_root_device_type", "ebs"), + resource.TestCheckResourceAttr(resourceName, "custom_json", customJson), + resource.TestCheckResourceAttr(resourceName, "configuration_manager_version", "11.10"), + resource.TestCheckResourceAttr(resourceName, "use_opsworks_security_groups", "false"), + resource.TestCheckResourceAttr(resourceName, "use_custom_cookbooks", "true"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.type", "git"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.revision", "master"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.url", "https://github.com/aws/opsworks-example-cookbooks.git"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.username", "username"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.password", "password"), + resource.TestCheckResourceAttr(resourceName, "custom_cookbooks_source.0.ssh_key", sshKey), ), }, }, @@ -212,10 +227,9 @@ func TestAccAWSOpsWorksStack_classicEndpoints(t *testing.T) { } -func testAccCheckAWSOpsworksStackRecreated(t *testing.T, - before, after *opsworks.Stack) resource.TestCheckFunc { +func testAccCheckAWSOpsworksStackRecreated(t *testing.T, before, after *opsworks.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { - if *before.StackId == *after.StackId { + if aws.StringValue(before.StackId) == aws.StringValue(after.StackId) { t.Fatalf("Expected change of Opsworks StackIds, but both were %v", before.StackId) } return nil @@ -229,10 +243,10 @@ provider "aws" { } resource "aws_opsworks_stack" "main" { - name = "%s" - region = "us-west-2" - service_role_arn = aws_iam_role.opsworks_service.arn - default_instance_profile_arn = aws_iam_instance_profile.opsworks_instance.arn + name = "%s" + region = "us-west-2" + service_role_arn = aws_iam_role.opsworks_service.arn + default_instance_profile_arn = aws_iam_instance_profile.opsworks_instance.arn configuration_manager_version = "12" default_availability_zone = "us-west-2b" @@ -317,10 +331,10 @@ provider "aws" { } resource "aws_opsworks_stack" "main" { - name = "%s" - region = "us-west-2" - service_role_arn = aws_iam_role.opsworks_service.arn - default_instance_profile_arn = aws_iam_instance_profile.opsworks_instance.arn + name = "%s" + region = "us-west-2" + service_role_arn = aws_iam_role.opsworks_service.arn + default_instance_profile_arn = aws_iam_instance_profile.opsworks_instance.arn configuration_manager_version = "12" default_availability_zone = "us-west-2b" @@ -402,108 +416,16 @@ resource "aws_iam_instance_profile" "opsworks_instance" { //// Checkers and Utilities //////////////////////////// -func testAccAwsOpsworksStackCheckResourceAttrsCreate(zone, stackName string) resource.TestCheckFunc { - return resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "name", - stackName, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_availability_zone", - zone, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_os", - "Amazon Linux 2016.09", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_root_device_type", - "ebs", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_json", - `{"key": "value"}`, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "configuration_manager_version", - "11.10", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "use_opsworks_security_groups", - "false", - ), - ) -} - -func testAccAwsOpsworksStackCheckResourceAttrsUpdate(zone, stackName string) resource.TestCheckFunc { +func testAccCheckAWSOpsworksCreateStackAttributes(zone, stackName string) resource.TestCheckFunc { + resourceName := "aws_opsworks_stack.tf-acc" return resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "name", - stackName, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_availability_zone", - zone, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_os", - "Amazon Linux 2015.09", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "default_root_device_type", - "ebs", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_json", - `{"key": "value"}`, - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "configuration_manager_version", - "11.10", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "use_opsworks_security_groups", - "false", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "use_custom_cookbooks", - "true", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "manage_berkshelf", - "true", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_cookbooks_source.0.type", - "git", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_cookbooks_source.0.revision", - "master", - ), - resource.TestCheckResourceAttr( - "aws_opsworks_stack.tf-acc", - "custom_cookbooks_source.0.url", - "https://github.com/aws/opsworks-example-cookbooks.git", - ), + resource.TestCheckResourceAttr(resourceName, "name", stackName), + resource.TestCheckResourceAttr(resourceName, "default_availability_zone", zone), + resource.TestCheckResourceAttr(resourceName, "default_os", "Amazon Linux 2016.09"), + resource.TestCheckResourceAttr(resourceName, "default_root_device_type", "ebs"), + resource.TestCheckResourceAttr(resourceName, "custom_json", customJson), + resource.TestCheckResourceAttr(resourceName, "configuration_manager_version", "11.10"), + resource.TestCheckResourceAttr(resourceName, "use_opsworks_security_groups", "false"), ) } @@ -537,10 +459,10 @@ func testAccCheckAWSOpsworksStackExists( *opsstack = *resp.Stacks[0] if vpc { - if rs.Primary.Attributes["vpc_id"] != *opsstack.VpcId { + if rs.Primary.Attributes["vpc_id"] != aws.StringValue(opsstack.VpcId) { return fmt.Errorf("VPCID Got %s, expected %s", *opsstack.VpcId, rs.Primary.Attributes["vpc_id"]) } - if rs.Primary.Attributes["default_subnet_id"] != *opsstack.DefaultSubnetId { + if rs.Primary.Attributes["default_subnet_id"] != aws.StringValue(opsstack.DefaultSubnetId) { return fmt.Errorf("Default subnet Id Got %s, expected %s", *opsstack.DefaultSubnetId, rs.Primary.Attributes["default_subnet_id"]) } } @@ -549,147 +471,6 @@ func testAccCheckAWSOpsworksStackExists( } } -func testAccCheckAWSOpsworksCreateStackAttributes( - opsstack *opsworks.Stack, zone, stackName string) resource.TestCheckFunc { - return func(s *terraform.State) error { - if *opsstack.Name != stackName { - return fmt.Errorf("Unnexpected stackName: %s", *opsstack.Name) - } - - if *opsstack.DefaultAvailabilityZone != zone { - return fmt.Errorf("Unnexpected DefaultAvailabilityZone: %s", *opsstack.DefaultAvailabilityZone) - } - - if *opsstack.DefaultOs != "Amazon Linux 2016.09" { - return fmt.Errorf("Unnexpected stackName: %s", *opsstack.DefaultOs) - } - - if *opsstack.DefaultRootDeviceType != "ebs" { - return fmt.Errorf("Unnexpected DefaultRootDeviceType: %s", *opsstack.DefaultRootDeviceType) - } - - if *opsstack.CustomJson != `{"key": "value"}` { - return fmt.Errorf("Unnexpected CustomJson: %s", *opsstack.CustomJson) - } - - if *opsstack.ConfigurationManager.Version != "11.10" { - return fmt.Errorf("Unnexpected Version: %s", *opsstack.ConfigurationManager.Version) - } - - if *opsstack.UseOpsworksSecurityGroups { - return fmt.Errorf("Unnexpected UseOpsworksSecurityGroups: %t", *opsstack.UseOpsworksSecurityGroups) - } - - return nil - } -} - -func testAccCheckAWSOpsworksCreateStackAttributesWithCookbooks( - opsstack *opsworks.Stack, zone, stackName string) resource.TestCheckFunc { - return func(s *terraform.State) error { - if *opsstack.Name != stackName { - return fmt.Errorf("Unnexpected stackName: %s", *opsstack.Name) - } - - if *opsstack.DefaultAvailabilityZone != zone { - return fmt.Errorf("Unnexpected DefaultAvailabilityZone: %s", *opsstack.DefaultAvailabilityZone) - } - - if *opsstack.DefaultOs != "Amazon Linux 2016.09" { - return fmt.Errorf("Unnexpected defaultOs: %s", *opsstack.DefaultOs) - } - - if *opsstack.DefaultRootDeviceType != "ebs" { - return fmt.Errorf("Unnexpected DefaultRootDeviceType: %s", *opsstack.DefaultRootDeviceType) - } - - if *opsstack.CustomJson != `{"key": "value"}` { - return fmt.Errorf("Unnexpected CustomJson: %s", *opsstack.CustomJson) - } - - if *opsstack.ConfigurationManager.Version != "11.10" { - return fmt.Errorf("Unnexpected Version: %s", *opsstack.ConfigurationManager.Version) - } - - if *opsstack.UseOpsworksSecurityGroups { - return fmt.Errorf("Unnexpected UseOpsworksSecurityGroups: %t", *opsstack.UseOpsworksSecurityGroups) - } - - if !*opsstack.UseCustomCookbooks { - return fmt.Errorf("Unnexpected UseCustomCookbooks: %t", *opsstack.UseCustomCookbooks) - } - - if *opsstack.CustomCookbooksSource.Type != "git" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Type) - } - - if *opsstack.CustomCookbooksSource.Revision != "master" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Revision) - } - - if *opsstack.CustomCookbooksSource.Url != "https://github.com/aws/opsworks-example-cookbooks.git" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Url) - } - - if *opsstack.CustomCookbooksSource.Username != "username" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Username) - } - - return nil - } -} - -func testAccCheckAWSOpsworksUpdateStackAttributes( - opsstack *opsworks.Stack, zone, stackName string) resource.TestCheckFunc { - return func(s *terraform.State) error { - if *opsstack.Name != stackName { - return fmt.Errorf("Unnexpected stackName: %s", *opsstack.Name) - } - - if *opsstack.DefaultAvailabilityZone != zone { - return fmt.Errorf("Unnexpected DefaultAvailabilityZone: %s", *opsstack.DefaultAvailabilityZone) - } - - if *opsstack.DefaultOs != "Amazon Linux 2015.09" { - return fmt.Errorf("Unnexpected stackName: %s", *opsstack.DefaultOs) - } - - if *opsstack.DefaultRootDeviceType != "ebs" { - return fmt.Errorf("Unnexpected DefaultRootDeviceType: %s", *opsstack.DefaultRootDeviceType) - } - - if *opsstack.CustomJson != `{"key": "value"}` { - return fmt.Errorf("Unnexpected CustomJson: %s", *opsstack.CustomJson) - } - - if *opsstack.ConfigurationManager.Version != "11.10" { - return fmt.Errorf("Unnexpected Version: %s", *opsstack.ConfigurationManager.Version) - } - - if !*opsstack.UseCustomCookbooks { - return fmt.Errorf("Unnexpected UseCustomCookbooks: %t", *opsstack.UseCustomCookbooks) - } - - if !*opsstack.ChefConfiguration.ManageBerkshelf { - return fmt.Errorf("Unnexpected ManageBerkshelf: %t", *opsstack.ChefConfiguration.ManageBerkshelf) - } - - if *opsstack.CustomCookbooksSource.Type != "git" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Type) - } - - if *opsstack.CustomCookbooksSource.Revision != "master" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Revision) - } - - if *opsstack.CustomCookbooksSource.Url != "https://github.com/aws/opsworks-example-cookbooks.git" { - return fmt.Errorf("Unnexpected *opsstack.CustomCookbooksSource.Type: %s", *opsstack.CustomCookbooksSource.Url) - } - - return nil - } -} - func testAccCheckAwsOpsworksStackDestroy(s *terraform.State) error { opsworksconn := testAccProvider.Meta().(*AWSClient).opsworksconn for _, rs := range s.RootModule().Resources { @@ -1545,3 +1326,7 @@ const sshKey = "-----BEGIN RSA PRIVATE KEY-----" + "Cdy6djI120bqDOifre1qnBjoHezrG+ejaQOTpocOVwT5Zl7BhjoXQZRGiQXj+2aD" + "tmm0+hpmkjX7jiPcljjs8S8gh+uCWieJoO4JNPk2SXRiePpYgKzdlg==" + "-----END RSA PRIVATE KEY-----" + +const customJson = `{ + "key": "value" +}` From 11726ff0a040042bd7487cc3c513d0c2df9c8ed6 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Fri, 28 Aug 2020 11:10:16 -0400 Subject: [PATCH 3/3] add "other" to source type values Co-authored-by: Brian Flad --- aws/resource_aws_opsworks_application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_opsworks_application.go b/aws/resource_aws_opsworks_application.go index b502b67ce84..36b25470f09 100644 --- a/aws/resource_aws_opsworks_application.go +++ b/aws/resource_aws_opsworks_application.go @@ -71,7 +71,7 @@ func resourceAwsOpsworksApplication() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice(opsworks.SourceType_Values(), false), + ValidateFunc: validation.StringInSlice(append(opsworks.SourceType_Values(), "other"), false), }, "url": {