Skip to content

Commit

Permalink
Fix kinesis firehose stream breaking for s3 destinations
Browse files Browse the repository at this point in the history
- import doesn't work for s3 destination
  • Loading branch information
ApsOps committed Jan 12, 2018
1 parent 36a004d commit 06b6643
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 4 additions & 5 deletions aws/resource_aws_kinesis_firehose_delivery_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,19 @@ func flattenKinesisFirehoseDeliveryStream(d *schema.ResourceData, s *firehose.De
elasticsearchConfList[0] = elasticsearchConfiguration
d.Set("elasticsearch_configuration", elasticsearchConfList)
d.Set("s3_configuration", flattenFirehoseS3Configuration(*destination.ElasticsearchDestinationDescription.S3DestinationDescription))
} else if destination.S3DestinationDescription != nil {
} else if d.Get("destination").(string) == "s3" {
d.Set("destination", "s3")
d.Set("s3_configuration", flattenFirehoseS3Configuration(*destination.S3DestinationDescription))
} else if destination.ExtendedS3DestinationDescription != nil {
} else {
d.Set("destination", "extended_s3")

extendedS3Configuration := map[string]interface{}{
"buffering_interval": *destination.ExtendedS3DestinationDescription.BufferingHints.IntervalInSeconds,
"buffering_size": *destination.ExtendedS3DestinationDescription.BufferingHints.SizeInMBs,
"buffer_interval": *destination.ExtendedS3DestinationDescription.BufferingHints.IntervalInSeconds,
"buffer_size": *destination.ExtendedS3DestinationDescription.BufferingHints.SizeInMBs,
"bucket_arn": *destination.ExtendedS3DestinationDescription.BucketARN,
"role_arn": *destination.ExtendedS3DestinationDescription.RoleARN,
"compression_format": *destination.ExtendedS3DestinationDescription.CompressionFormat,
"prefix": *destination.ExtendedS3DestinationDescription.Prefix,
"s3_backup_mode": *destination.ExtendedS3DestinationDescription.S3BackupMode,
"cloudwatch_logging_options": flattenCloudwatchLoggingOptions(*destination.ExtendedS3DestinationDescription.CloudWatchLoggingOptions),
}
if destination.ExtendedS3DestinationDescription.EncryptionConfiguration.KMSEncryptionConfig != nil {
Expand Down
10 changes: 10 additions & 0 deletions website/docs/r/kinesis_firehose_delivery_stream.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,13 @@ The `parameters` array objects support the following:
* `arn` - The Amazon Resource Name (ARN) specifying the Stream

[1]: https://aws.amazon.com/documentation/firehose/

## Import

Kinesis Firehose Delivery streams can be imported using the stream ARN, e.g.

```
$ terraform import aws_kinesis_firehose_delivery_stream.foo arn:aws:firehose:us-east-1:XXX:deliverystream/example
```

Note: Import does not work for stream destination `s3`. Consider using `extended_s3` since `s3` destination is deprecated.

0 comments on commit 06b6643

Please sign in to comment.