File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed
Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ 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
25+ is_dev_env = local. stack_name == " dev "
2626
2727 environment = local. is_sandbox_env ? " ${ var . account_name } -sandbox" : var. account_name
2828 shared_prefix = " ${ local . project } --${ local . environment } "
2929 public_domain = local. is_sandbox_env ? var. public_sandbox_domain : var. public_domain
3030
3131 # Logic / vars for reporting
32- reporting_bucket_arn = local. is_dev_env ? data. aws_s3_bucket . source-data-bucket [0 ]. arn : null
32+ reporting_bucket_arn = local. is_dev_env ? data. aws_s3_bucket . source-data-bucket [0 ]. arn : data . aws_s3_bucket . source-data-bucket . arn
3333
3434 # Logic / vars for splunk environment
3535 splunk_environment = local. is_sandbox_env ? " ${ var . account_name } sandbox" : var. account_name
Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ data "aws_iam_policy_document" "firehose" {
7474 ]
7575 resources = [
7676 aws_cloudwatch_log_group . firehose . arn ,
77- aws_cloudwatch_log_stream . firehose . arn
77+ aws_cloudwatch_log_stream . firehose . arn ,
78+ local . iam_firehose . cloudwatch_reporting_log_group_arn ,
79+ local . iam_firehose . cloudwatch_reporting_log_stream_arn ,
7880 ]
7981 effect = " Allow"
8082 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ data "aws_iam_policy_document" "firehose_subscription" {
2222 effect = " Allow"
2323 resources = [
2424 aws_kinesis_firehose_delivery_stream . firehose . arn ,
25- aws_kinesis_firehose_delivery_stream . reporting_stream . arn ,
25+ local . iam_subscriptions . firehose_reporting_stream_arn ,
2626 ]
2727 }
2828 statement {
Original file line number Diff line number Diff line change @@ -31,4 +31,13 @@ locals {
3131 compression_format = " GZIP"
3232 }
3333
34+ iam_firehose = {
35+ cloudwatch_reporting_log_group_arn = var.reporting_infra_toggle ? aws_cloudwatch_log_group.firehose_reporting[0 ].arn : aws_cloudwatch_log_group.firehose_reporting.arn
36+ cloudwatch_reporting_log_stream_arn = var.reporting_infra_toggle ? aws_cloudwatch_log_stream.firehose_reporting[0 ].arn : aws_cloudwatch_log_stream.firehose_reporting.arn
37+ }
38+
39+ iam_subscriptions = {
40+ firehose_reporting_stream_arn = var.reporting_infra_toggle ? aws_kinesis_firehose_delivery_stream.reporting_stream[0 ].arn : aws_kinesis_firehose_delivery_stream.reporting_stream.arn
41+ }
42+
3443}
You can’t perform that action at this time.
0 commit comments