From 0b1cf74280e7c01643772287be09a31521ec7b2d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 15 Aug 2019 12:22:25 -0400 Subject: [PATCH 1/2] Correct validations for AWS Cloud Map service discovery information for App Mesh virtual nodes. --- aws/resource_aws_appmesh_virtual_node.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_appmesh_virtual_node.go b/aws/resource_aws_appmesh_virtual_node.go index fdabb951904..9cf0e1a5bc5 100644 --- a/aws/resource_aws_appmesh_virtual_node.go +++ b/aws/resource_aws_appmesh_virtual_node.go @@ -235,12 +235,13 @@ func resourceAwsAppmeshVirtualNode() *schema.Resource { "namespace_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validateServiceDiscoveryHttpNamespaceName, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "service_name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1, 1024), }, }, }, From 477b3e0c07840d3c87172f541d3c079eee06d3fc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 4 Oct 2019 17:51:46 -0400 Subject: [PATCH 2/2] Avoid 'config is invalid: last character of "name" must be a letter' for aws_service_discovery_http_namespace. --- aws/resource_aws_appmesh_virtual_node_test.go | 3 ++- aws/resource_aws_service_discovery_service_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_appmesh_virtual_node_test.go b/aws/resource_aws_appmesh_virtual_node_test.go index c0fb70fe93a..03795906762 100644 --- a/aws/resource_aws_appmesh_virtual_node_test.go +++ b/aws/resource_aws_appmesh_virtual_node_test.go @@ -55,7 +55,8 @@ func testAccAwsAppmeshVirtualNode_cloudMapServiceDiscovery(t *testing.T) { nsResourceName := "aws_service_discovery_http_namespace.test" meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - rName := fmt.Sprintf("tf-testacc-appmeshvn-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + // Avoid 'config is invalid: last character of "name" must be a letter' for aws_service_discovery_http_namespace. + rName := fmt.Sprintf("tf-testacc-appmeshvn-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlpha)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/aws/resource_aws_service_discovery_service_test.go b/aws/resource_aws_service_discovery_service_test.go index 485d69c60fd..79792dc1012 100644 --- a/aws/resource_aws_service_discovery_service_test.go +++ b/aws/resource_aws_service_discovery_service_test.go @@ -93,7 +93,7 @@ func TestAccAWSServiceDiscoveryService_public(t *testing.T) { } func TestAccAWSServiceDiscoveryService_http(t *testing.T) { - rName := acctest.RandString(5) + rName := acctest.RandStringFromCharSet(5, acctest.CharSetAlpha) resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{