diff --git a/builtin/providers/aws/resource_aws_ecs_service_test.go b/builtin/providers/aws/resource_aws_ecs_service_test.go index 53d38ccbd..f622d64b7 100644 --- a/builtin/providers/aws/resource_aws_ecs_service_test.go +++ b/builtin/providers/aws/resource_aws_ecs_service_test.go @@ -244,13 +244,15 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { } func TestAccAWSEcsService_withAlb(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc") + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithAlb, + Config: testAccAWSEcsServiceWithAlb(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists("aws_ecs_service.with_alb"), ), @@ -874,11 +876,15 @@ resource "aws_ecs_service" "jenkins" { } ` -var testAccAWSEcsServiceWithAlb = ` +func testAccAWSEcsServiceWithAlb(rName string) string { + return fmt.Sprintf(` data "aws_availability_zones" "available" {} resource "aws_vpc" "main" { cidr_block = "10.10.0.0/16" + tags { + Name = "TestAccAWSEcsService_withAlb" + } } resource "aws_subnet" "main" { @@ -889,11 +895,11 @@ resource "aws_subnet" "main" { } resource "aws_ecs_cluster" "main" { - name = "terraform_acc_test_ecs_15" + name = "%s" } resource "aws_ecs_task_definition" "with_lb_changes" { - family = "tf_acc_test_ghost_lbd" + family = "%s" container_definitions = <