
terraform-aws-arc-kinesis-firehose¶
Overview¶
This module provisions and manages Kinesis Data Firehose delivery streams with full support for multiple destinations, IAM roles, CloudWatch logging, Lambda transformation, KMS encryption, and dynamic partitioning.
Features¶
- Multiple destinations:
extended_s3,redshift,opensearch,http_endpoint - Auto-created IAM role with least-privilege policies (or bring your own)
- CloudWatch logging with auto-created log group and stream
- KMS encryption support (AWS-managed or customer-managed)
- Lambda data transformation via processing configuration
- Parquet/ORC format conversion via AWS Glue
- Dynamic partitioning with JQ metadata extraction
- S3 backup for all non-S3 destinations
- VPC support for OpenSearch destinations
- Kinesis Data Stream as source
Usage¶
Basic S3¶
S3 with KMS Encryption¶
With Lambda Transformation¶
Redshift¶
OpenSearch¶
Dynamic Partitioning¶
Examples¶
| Example | Description |
|---|---|
| basic-s3 | Simple delivery to S3 with GZIP |
| s3-encrypted | S3 with KMS encryption and optional Parquet |
| redshift | Delivery to Redshift via S3 staging |
| lambda-transform | Lambda data transformation before S3 |
| opensearch | Delivery to OpenSearch domain |
| dynamic-partitioning | S3 with JQ-based dynamic partitioning |
License¶
Apache 2.0 — see LICENSE.
Requirements¶
| Name | Version |
|---|---|
| terraform | >= 1.5.0 |
| aws | >= 5.0, < 7.0 |
Providers¶
| Name | Version |
|---|---|
| aws | 6.42.0 |
Modules¶
No modules.
Resources¶
| Name | Type |
|---|---|
| aws_cloudwatch_log_group.firehose | resource |
| aws_cloudwatch_log_stream.firehose | resource |
| aws_iam_role.firehose | resource |
| aws_iam_role_policy.firehose | resource |
| aws_kinesis_firehose_delivery_stream.this | resource |
| aws_caller_identity.current | data source |
| aws_iam_policy_document.firehose_assume_role | data source |
| aws_iam_policy_document.firehose_policy | data source |
| aws_partition.current | data source |
| aws_region.current | data source |
Inputs¶
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| additional_processors | Additional processing configuration blocks (e.g., MetadataExtraction, RecordDeAggregation). | list(object({ |
[] |
no |
| create_iam_role | Whether to create an IAM role for Firehose. Set false to provide an existing role via iam_role_arn. | bool |
true |
no |
| destination | Destination type. Valid values: extended_s3, redshift, opensearch, http_endpoint. | string |
n/a | yes |
| dynamic_partitioning_retry_duration | Retry duration in seconds for dynamic partitioning (0–7200). | number |
300 |
no |
| enable_dynamic_partitioning | Enable dynamic partitioning for extended_s3 destination. | bool |
false |
no |
| enable_format_conversion | Enable data format conversion (Parquet/ORC) via AWS Glue. | bool |
false |
no |
| enable_sse | Enable server-side encryption on the delivery stream. | bool |
true |
no |
| glue_database_name | Glue database name for schema. Required when enable_format_conversion is true. | string |
null |
no |
| glue_role_arn | IAM role ARN for Glue access. Defaults to the Firehose role. | string |
null |
no |
| glue_table_name | Glue table name for schema. Required when enable_format_conversion is true. | string |
null |
no |
| http_endpoint_configuration | Configuration block for HTTP endpoint destination. | object({ |
null |
no |
| iam_role_arn | ARN of an existing IAM role. Required when create_iam_role is false. | string |
null |
no |
| kinesis_data_stream | Kinesis Data Stream source configuration. | object({ |
null |
no |
| kms_key_arn | ARN of a KMS key for server-side encryption. If null, AWS-managed key is used. | string |
null |
no |
| lambda_arn | ARN of the Lambda function for data transformation. Enables transformation when set. | string |
null |
no |
| logging_config | CloudWatch logging configuration for the delivery stream. | object({ |
{} |
no |
| name | Name of the Kinesis Firehose delivery stream. | string |
n/a | yes |
| opensearch_configuration | Configuration block for OpenSearch destination. | object({ |
null |
no |
| opensearch_domain_arn | ARN of the OpenSearch domain. | string |
null |
no |
| output_format | Output format for format conversion. Valid values: PARQUET, ORC. | string |
"PARQUET" |
no |
| redshift_configuration | Configuration block for Redshift destination. | object({ |
null |
no |
| s3_backup_configuration | S3 backup configuration for extended_s3 destination. | object({ |
{} |
no |
| s3_configuration | S3 delivery/staging configuration. | object({ |
{} |
no |
| tags | Map of tags to assign to all resources. | map(string) |
{} |
no |
| vpc_config | VPC configuration for OpenSearch destination. | object({ |
null |
no |
Outputs¶
| Name | Description |
|---|---|
| iam_role_arn | ARN of the IAM role used by Firehose. |
| iam_role_name | Name of the IAM role created for Firehose (null if externally provided). |
| log_group_name | CloudWatch log group name. |
| log_stream_name | CloudWatch log stream name. |
| stream_arn | ARN of the Kinesis Firehose delivery stream. |
| stream_name | Name of the Kinesis Firehose delivery stream. |
Versioning¶
This project uses a .version file at the root of the repo which the pipeline reads from and does a git tag.
When you intend to commit to main, you will need to increment this version. Once the project is merged,
the pipeline will kick off and tag the latest git commit.
Development¶
Prerequisites¶
Configurations¶
- Configure pre-commit hooks
Versioning¶
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
For Example
Tests¶
- Tests are available in
testdirectory - Configure the dependencies
- Now execute the test
Authors¶
This project is authored by: - SourceFuse ARC Team