From 1a11d3277045d3588628e4f497c5cdf6338be34e Mon Sep 17 00:00:00 2001 From: Fabio Santos Date: Mon, 19 Feb 2024 09:25:04 +0000 Subject: [PATCH] chore: Remove deprecated variable: enable_kinesis_source --- README.md | 17 +++++------------ UPGRADE-3.0.md | 4 ++++ examples/s3/kinesis-to-s3-basic/main.tf | 2 +- examples/s3/kinesis-to-s3-complete/main.tf | 2 +- iam.tf | 6 +++--- locals.tf | 2 +- variables.tf | 6 ------ 7 files changed, 15 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 55b2210..6758877 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Supports all destinations and all Kinesis Firehose Features. #### Kinesis Data Stream -**To Enabled it:** `input_source = "kinesis"`. The use of variable `enable_kinesis_source` is deprecated and will be removed on next Major Release. +**To Enabled it:** `input_source = "kinesis"`. ```hcl module "firehose" { @@ -124,7 +124,7 @@ module "firehose" { If Kinesis Data Stream is encrypted, it's necessary pass this info to module . -**To Enabled It:** `input_source = "kinesis"`. The use of variable `enable_kinesis_source` is deprecated and will be removed on next Major Release. +**To Enabled It:** `input_source = "kinesis"`. **KMS Key:** use `kinesis_source_kms_arn` variable to indicate the KMS Key to module add permissions to policy to decrypt the Kinesis Data Stream. @@ -499,7 +499,7 @@ module "firehose" { source = "fdmsantos/kinesis-firehose/aws" version = "x.x.x" name = "firehose-delivery-stream" - enable_kinesis_source = true + input_source = "kinesis" kinesis_source_stream_arn = "" destination = "s3" # or destination = "extended_s3" s3_bucket_arn = "" @@ -524,7 +524,7 @@ module "firehose" { source = "fdmsantos/kinesis-firehose/aws" version = "x.x.x" name = "firehose-delivery-stream" - enable_kinesis_source = true + input_source = "kinesis" kinesis_source_stream_arn = "" destination = "s3" # or destination = "extended_s3" s3_bucket_arn = "" @@ -550,7 +550,7 @@ module "firehose" { source = "fdmsantos/kinesis-firehose/aws" version = "x.x.x" name = "firehose-delivery-stream" - enable_kinesis_source = true + input_source = "kinesis" kinesis_source_stream_arn = "" destination = "s3" # or destination = "extended_s3" s3_bucket_arn = "" @@ -958,7 +958,6 @@ No modules. | [enable\_data\_format\_conversion](#input\_enable\_data\_format\_conversion) | Set it to true if you want to disable format conversion. | `bool` | `false` | no | | [enable\_destination\_log](#input\_enable\_destination\_log) | The CloudWatch Logging Options for the delivery stream | `bool` | `true` | no | | [enable\_dynamic\_partitioning](#input\_enable\_dynamic\_partitioning) | Enables or disables dynamic partitioning | `bool` | `false` | no | -| [enable\_kinesis\_source](#input\_enable\_kinesis\_source) | DEPRECATED: Use instead `input_source = "kinesis"` | `bool` | `false` | no | | [enable\_lambda\_transform](#input\_enable\_lambda\_transform) | Set it to true to enable data transformation with lambda | `bool` | `false` | no | | [enable\_s3\_backup](#input\_enable\_s3\_backup) | The Amazon S3 backup mode | `bool` | `false` | no | | [enable\_s3\_encryption](#input\_enable\_s3\_encryption) | Indicates if want use encryption in S3 bucket. | `bool` | `false` | no | @@ -1095,12 +1094,6 @@ No modules. | [s3\_cross\_account\_bucket\_policy](#output\_s3\_cross\_account\_bucket\_policy) | Bucket Policy to S3 Bucket Destination when the bucket belongs to another account | -## Deprecation - -### Version >= 2.1.0 - -* variable `enable_kinesis_source` is deprecated. Use instead `input_source = "kinesis"`. - ## Upgrade - Version 1.x to 2.x Upgrade Guide [here](https://github.com/fdmsantos/terraform-aws-kinesis-firehose/blob/main/UPGRADE-2.0.md) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index ef954a0..a06f1fd 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -34,3 +34,7 @@ If you find a bug, please open an issue with supporting configuration to reprodu 4. Added variables: - All variables prefixed with opensearch and opensearchserverless + +5. Deprecations + + - Variable `enable_kinesis_source` removed. Use instead `input_source = "kinesis"`. diff --git a/examples/s3/kinesis-to-s3-basic/main.tf b/examples/s3/kinesis-to-s3-basic/main.tf index 743bb3d..d902784 100644 --- a/examples/s3/kinesis-to-s3-basic/main.tf +++ b/examples/s3/kinesis-to-s3-basic/main.tf @@ -25,7 +25,7 @@ resource "aws_kinesis_stream" "this" { module "firehose" { source = "../../../" name = "${var.name_prefix}-delivery-stream" - enable_kinesis_source = true + input_source = "kinesis" kinesis_source_stream_arn = aws_kinesis_stream.this.arn destination = "s3" s3_bucket_arn = aws_s3_bucket.s3.arn diff --git a/examples/s3/kinesis-to-s3-complete/main.tf b/examples/s3/kinesis-to-s3-complete/main.tf index b5a9b13..e037d51 100644 --- a/examples/s3/kinesis-to-s3-complete/main.tf +++ b/examples/s3/kinesis-to-s3-complete/main.tf @@ -41,7 +41,7 @@ module "firehose" { name = "${var.name_prefix}-delivery-stream" buffering_size = 100 buffering_interval = 100 - enable_kinesis_source = true + input_source = "kinesis" kinesis_source_stream_arn = aws_kinesis_stream.this.arn destination = "s3" s3_bucket_arn = aws_s3_bucket.s3.arn diff --git a/iam.tf b/iam.tf index 0debbb1..29d44cc 100644 --- a/iam.tf +++ b/iam.tf @@ -404,7 +404,7 @@ data "aws_iam_policy_document" "cross_account_elasticsearch" { ################## # OpenSearch ################## -data "aws_iam_policy_document" "opensearch" { # TODO Change Actions +data "aws_iam_policy_document" "opensearch" { count = local.add_opensearch_policy ? 1 : 0 statement { effect = "Allow" @@ -455,7 +455,7 @@ resource "aws_iam_role_policy_attachment" "opensearch" { policy_arn = aws_iam_policy.opensearch[0].arn } -data "aws_iam_policy_document" "cross_account_opensearch" { # TODO Change Actions +data "aws_iam_policy_document" "cross_account_opensearch" { count = local.add_opensearch_policy && var.destination_cross_account ? 1 : 0 version = "2012-10-17" statement { @@ -482,7 +482,7 @@ data "aws_iam_policy_document" "cross_account_opensearch" { # TODO Change Action "${var.opensearch_domain_arn}/${var.opensearch_index_name}*/_stats" ] } -} # TODO Change Actions +} resource "aws_iam_service_linked_role" "opensearch" { count = contains(["elasticsearch", "opensearch"], local.destination) && var.enable_vpc && var.opensearch_vpc_create_service_linked_role ? 1 : 0 diff --git a/locals.tf b/locals.tf index ae32ec4..a8cabe9 100644 --- a/locals.tf +++ b/locals.tf @@ -3,7 +3,7 @@ locals { cw_log_group_name = "/aws/kinesisfirehose/${var.name}" cw_log_delivery_stream_name = "DestinationDelivery" cw_log_backup_stream_name = "BackupDelivery" - source = var.enable_kinesis_source ? "kinesis" : var.input_source # TODO: This should be removed when delete enable_kinesis_source variable (Next Major Version) + source = var.input_source is_kinesis_source = local.source == "kinesis" ? true : false is_waf_source = local.source == "waf" ? true : false destinations = { diff --git a/variables.tf b/variables.tf index efb6737..0702971 100644 --- a/variables.tf +++ b/variables.tf @@ -361,12 +361,6 @@ variable "sse_kms_key_arn" { default = null } -variable "enable_kinesis_source" { - description = "DEPRECATED: Use instead `input_source = \"kinesis\"`" - type = bool - default = false -} - variable "kinesis_source_stream_arn" { description = "The kinesis stream used as the source of the firehose delivery stream" type = string