From 126c36deea6f9270c9f041117482f64451f1d6a2 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 15 Jan 2018 15:18:56 +0000 Subject: [PATCH] Avoid crash on empty redshift's S3BackupDescription Fixes #3006 --- 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 5592202cdde..2c16a94eb3f 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream.go @@ -241,10 +241,12 @@ func flattenKinesisFirehoseDeliveryStream(d *schema.ResourceData, s *firehose.De "copy_options": *destination.RedshiftDestinationDescription.CopyCommand.CopyOptions, "data_table_columns": *destination.RedshiftDestinationDescription.CopyCommand.DataTableColumns, "s3_backup_mode": *destination.RedshiftDestinationDescription.S3BackupMode, - "s3_backup_configuration": flattenFirehoseS3Configuration(*destination.RedshiftDestinationDescription.S3BackupDescription), "retry_duration": *destination.RedshiftDestinationDescription.RetryOptions.DurationInSeconds, "cloudwatch_logging_options": flattenCloudwatchLoggingOptions(*destination.RedshiftDestinationDescription.CloudWatchLoggingOptions), } + if s3bd := destination.RedshiftDestinationDescription.S3BackupDescription; s3bd != nil { + redshiftConfiguration["s3_backup_configuration"] = flattenFirehoseS3Configuration(*s3bd) + } redshiftConfList := make([]map[string]interface{}, 1) redshiftConfList[0] = redshiftConfiguration d.Set("redshift_configuration", redshiftConfList)