From ef4edcc3c933d7280d4beb4acd87791510185059 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Jan 2018 15:38:26 -0500 Subject: [PATCH] resource/aws_kinesis_firehose_delivery_stream: Prevent panic on missing S3 configuration prefix --- aws/resource_aws_kinesis_firehose_delivery_stream.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream.go b/aws/resource_aws_kinesis_firehose_delivery_stream.go index 0ba21640121..ce4e74c13d4 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream.go @@ -190,7 +190,6 @@ func flattenFirehoseS3Configuration(s3 firehose.S3DestinationDescription) []inte s3Configuration := map[string]interface{}{ "role_arn": *s3.RoleARN, "bucket_arn": *s3.BucketARN, - "prefix": *s3.Prefix, "buffer_size": *s3.BufferingHints.SizeInMBs, "buffer_interval": *s3.BufferingHints.IntervalInSeconds, "compression_format": *s3.CompressionFormat, @@ -201,6 +200,9 @@ func flattenFirehoseS3Configuration(s3 firehose.S3DestinationDescription) []inte if s3.EncryptionConfiguration.KMSEncryptionConfig != nil { s3Configuration["kms_key_arn"] = *s3.EncryptionConfiguration.KMSEncryptionConfig } + if s3.Prefix != nil { + s3Configuration["prefix"] = *s3.Prefix + } return []interface{}{s3Configuration} }