File tree Expand file tree Collapse file tree 6 files changed +25
-11
lines changed
Expand file tree Collapse file tree 6 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -43,5 +43,6 @@ data "external" "current-info" {
4343}
4444
4545data "aws_s3_bucket" "source-data-bucket" {
46+ count = local. is_dev_env ? 1 : 0
4647 bucket = " ${ local . shared_prefix } -source-data-bucket"
4748}
Original file line number Diff line number Diff line change 11module "firehose__processor" {
2- source = " ./modules/firehose"
3- assume_account = local. aws_account_id
4- prefix = local. prefix
5- region = local. region
6- environment = local. environment
7- cloudwatch_kms_arn = module. kms__cloudwatch . kms_arn
8- splunk_environment = local. splunk_environment
9- splunk_index = local. splunk_index
10- destination = " splunk"
11- reporting_bucket_arn = data. aws_s3_bucket . source-data-bucket . arn
2+ source = " ./modules/firehose"
3+ assume_account = local. aws_account_id
4+ prefix = local. prefix
5+ region = local. region
6+ environment = local. environment
7+ cloudwatch_kms_arn = module. kms__cloudwatch . kms_arn
8+ splunk_environment = local. splunk_environment
9+ splunk_index = local. splunk_index
10+ destination = " splunk"
11+ reporting_bucket_arn = local. reporting_bucket_arn
12+ reporting_infra_toggle = local. is_dev_env
1213}
Original file line number Diff line number Diff line change @@ -22,11 +22,15 @@ locals {
2222 dynamodb_timeout_seconds = " 3"
2323
2424 is_sandbox_env = length (regexall (" -sandbox-" , local. stack_name )) > 0
25+ is_dev_env = length (regexall (" dev" , local. stack_name )) > 0
2526
2627 environment = local. is_sandbox_env ? " ${ var . account_name } -sandbox" : var. account_name
2728 shared_prefix = " ${ local . project } --${ local . environment } "
2829 public_domain = local. is_sandbox_env ? var. public_sandbox_domain : var. public_domain
2930
31+ # Logic / vars for reporting
32+ reporting_bucket_arn = local. is_dev_env ? data. aws_s3_bucket . source-data-bucket . arn : null
33+
3034 # Logic / vars for splunk environment
3135 splunk_environment = local. is_sandbox_env ? " ${ var . account_name } sandbox" : var. account_name
3236 splunk_index = " aws_recordlocator_${ local . splunk_environment } "
Original file line number Diff line number Diff line change @@ -9,11 +9,13 @@ resource "aws_cloudwatch_log_stream" "firehose" {
99}
1010
1111resource "aws_cloudwatch_log_group" "firehose_reporting" {
12+ count = var. reporting_infra_toggle ? 1 : 0
1213 name = " /aws/kinesisfirehose/${ var . prefix } -firehose-reporting"
1314 retention_in_days = local. cloudwatch . retention . days
1415}
1516
1617resource "aws_cloudwatch_log_stream" "firehose_reporting" {
18+ count = var. reporting_infra_toggle ? 1 : 0
1719 name = " ${ var . prefix } -firehose-reporting"
1820 log_group_name = aws_cloudwatch_log_group. firehose_reporting . name
1921}
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ resource "aws_kinesis_firehose_delivery_stream" "firehose" {
5858}
5959
6060resource "aws_kinesis_firehose_delivery_stream" "reporting_stream" {
61+ count = var. reporting_infra_toggle ? 1 : 0
6162 name = " ${ var . prefix } --cloudwatch-reporting-delivery-stream"
6263 destination = " extended_s3"
6364
Original file line number Diff line number Diff line change @@ -36,5 +36,10 @@ variable "error_prefix" {
3636}
3737
3838variable "reporting_bucket_arn" {
39- type = string
39+ type = string
40+ default = null
41+ }
42+
43+ variable "reporting_infra_toggle" {
44+ type = bool
4045}
You can’t perform that action at this time.
0 commit comments