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), }, }, }, 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{