diff --git a/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook_test.go b/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook_test.go index ad5a7a8a7..7fece49a2 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook_test.go +++ b/builtin/providers/aws/resource_aws_autoscaling_lifecycle_hook_test.go @@ -19,7 +19,7 @@ func TestAccAWSAutoscalingLifecycleHook_basic(t *testing.T) { Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingLifecycleHookDestroy, Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccAWSAutoscalingLifecycleHookConfig(resourceName), Check: resource.ComposeTestCheckFunc( testAccCheckLifecycleHookExists("aws_autoscaling_lifecycle_hook.foobar"), @@ -34,13 +34,15 @@ func TestAccAWSAutoscalingLifecycleHook_basic(t *testing.T) { } func TestAccAWSAutoscalingLifecycleHook_omitDefaultResult(t *testing.T) { + rName := acctest.RandString(10) + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingLifecycleHookDestroy, Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccAWSAutoscalingLifecycleHookConfig_omitDefaultResult(acctest.RandString(10)), + { + Config: testAccAWSAutoscalingLifecycleHookConfig_omitDefaultResult(rName, rInt), Check: resource.ComposeTestCheckFunc( testAccCheckLifecycleHookExists("aws_autoscaling_lifecycle_hook.foobar"), resource.TestCheckResourceAttr("aws_autoscaling_lifecycle_hook.foobar", "default_result", "ABANDON"), @@ -191,7 +193,7 @@ EOF `, name, name) } -func testAccAWSAutoscalingLifecycleHookConfig_omitDefaultResult(name string) string { +func testAccAWSAutoscalingLifecycleHookConfig_omitDefaultResult(name string, rInt int) string { return fmt.Sprintf(` resource "aws_launch_configuration" "foobar" { name = "%s" @@ -208,7 +210,7 @@ resource "aws_sqs_queue" "foobar" { } resource "aws_iam_role" "foobar" { - name = "foobar" + name = "foobar-%d" assume_role_policy = <