From 10f0c21bd226e4a812001ee5a27ae86596f9fce8 Mon Sep 17 00:00:00 2001 From: Alessandro Arnone Date: Wed, 13 Jun 2018 16:53:15 +0100 Subject: [PATCH] Add test to reproduce issue #4392 --- ...s_kinesis_firehose_delivery_stream_test.go | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index d499a3797d9..5e5228693d1 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -483,6 +483,33 @@ func TestAccAWSKinesisFirehoseDeliveryStream_missingProcessingConfiguration(t *t }) } +func TestAccAWSKinesisFirehoseDeliveryStream_disabledProcessingConfiguration(t *testing.T) { + var stream firehose.DeliveryStreamDescription + ri := acctest.RandInt() + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, + Steps: []resource.TestStep{ + { + Config: testAccKinesisFirehoseDeliveryStreamConfig_withDisabledProcessingConfiguration(ri), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil), + ), + }, + { + Config: testAccKinesisFirehoseDeliveryStreamConfig_missingProcessingConfiguration(ri), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test_stream", &stream), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil), + ), + }, + }, + }) +} + func testAccCheckKinesisFirehoseDeliveryStreamExists(n string, stream *firehose.DeliveryStreamDescription) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -1435,3 +1462,89 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { } `, rInt, rInt, rInt, rInt) } + +func testAccKinesisFirehoseDeliveryStreamConfig_withDisabledProcessingConfiguration(rInt int) string { + return fmt.Sprintf(` +resource "aws_iam_role" "firehose" { + name = "tf_acctest_firehose_delivery_role_%d" + assume_role_policy = <