diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go index 4d17859d5..f0fded016 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter.go @@ -144,7 +144,9 @@ func resourceAwsCloudwatchLogSubscriptionFilterRead(d *schema.ResourceData, meta } } - return fmt.Errorf("Subscription filter for log group %s with name prefix %s not found!", log_group_name, d.Get("name").(string)) + log.Printf("[DEBUG] Subscription Filter%q Not Found", name) + d.SetId("") + return nil } func resourceAwsCloudwatchLogSubscriptionFilterDelete(d *schema.ResourceData, meta interface{}) error { diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go index 143da6070..741ff20b2 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_subscription_filter_test.go @@ -102,7 +102,7 @@ func testAccCheckAWSCloudwatchLogSubscriptionFilterAttributes(function *lambda.G func testAccAWSCloudwatchLogSubscriptionFilterConfig(rstring string) string { return fmt.Sprintf(` resource "aws_cloudwatch_log_subscription_filter" "test_lambdafunction_logfilter" { - name = "test_lambdafunction_logfilter" + name = "test_lambdafunction_logfilter_%s" log_group_name = "example_lambda_name" filter_pattern = "logtype test" destination_arn = "${aws_lambda_function.test_lambdafunction.arn}" @@ -117,7 +117,7 @@ resource "aws_lambda_function" "test_lambdafunction" { } resource "aws_cloudwatch_log_group" "logs" { - name = "example_lambda_name" + name = "example_lambda_name_%s" retention_in_days = 1 } @@ -149,7 +149,7 @@ EOF } resource "aws_iam_role_policy" "test_lambdafunction_iam_policy" { - name = "test_lambdafunction_iam_policy" + name = "test_lambdafunction_iam_policy_%s" role = "${aws_iam_role.iam_for_lambda.id}" policy = <