Преглед изворни кода

Merge pull request #551 from mdr-engineering/feature/bp_MSOCI-1991_portal-lambda-logs

Adds moose_cloudwatch_logs
Brad Poulton пре 3 година
родитељ
комит
9d43769c33

+ 39 - 0
prod/aws-us-gov/mdr-prod-c2/370-moose-cloudwatch-logs/terragrunt.hcl

@@ -0,0 +1,39 @@
+locals {
+  # If you want to use any of the variables in _this_ file, you have to load them here.
+  # However, they will all be available as inputs to the module loaded in terraform.source
+  # below.
+
+  environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
+  partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
+  region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
+  account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
+  global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
+}
+
+# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
+# working directory, into a temporary folder, and execute your Terraform commands in that folder.
+terraform {
+  # Double slash is intentional and required to show root of modules
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/moose_cloudwatch_logs?ref=v3.5.7"
+}
+
+dependency "c2_account_standards" {
+  config_path = local.account_vars.locals.c2_account_standards_path
+}
+
+# Include all settings from the root terragrunt.hcl file
+include {
+  path = find_in_parent_folders()
+}
+
+# These are the variables we have to pass in to use the module specified in the terragrunt source above
+inputs = {
+  # All of the inputs from the inherited hcl files are available automatically
+  # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
+  # will be more flexible if you specify particular input values.
+  tags = {
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+  }
+}
+terraform_version_constraint = "= 1.0.7"
+terragrunt_version_constraint = "= 0.32.3"

+ 29 - 0
prod/aws-us-gov/mdr-prod-c2/account.hcl

@@ -240,4 +240,33 @@ locals {
   # Qualys Connector, defined in AssetView in Qualys Console
   qualys_connector_externalid = "1621818655116" # mdr-prod-c2-gov 
 
+  moose_cloudwatch_log_groups = {
+    "/aws/lambda/portal_customer_sync" = {
+      hec_token = "eb79bb2d-b27d-455d-bc5c-e8cf3165b294"
+      firehose_name = "portal_customer_sync_firehose"
+      lambda_function_name = "portal_customer_sync_kinesis_firehose_transform"
+      s3_bucket_name = "${local.account_name}-kinesis-flowlogs-portal-customer-sync-s3"
+      log_stream_name = "SplunkDelivery_portal_customer_sync"
+      kinesis_firehose_lambda_role_name = "KinesisFirehoseToLambaRole-portal_customer_sync"
+      kinesis_firehose_role_name = "kinesis-firehose-role-name-portal-customer-sync"
+      lambda_iam_policy_name = "Kinesis-Firehose-to-Splunk-Policy-portal_customer_sync"
+      kinesis_firehose_iam_policy_name = "KinesisFirehose-Policy-portal_customer_sync"
+      cloudwatch_to_firehose_trust_iam_role_name = "CloudWatchToSplunkFirehoseTrust-portal_customer_sync"
+      cloudwatch_to_fh_access_policy_name = "KinesisCloudWatchToFirehosePolicy-portal_customer_sync"
+    }
+    "/aws/lambda/portal_scheduler" = {
+      hec_token = "bce12568-f390-4b17-8dfe-ea26b856820b"
+      firehose_name = "portal_scheduler_firehose"
+      lambda_function_name = "portal_scheduler_kinesis_firehose_transform"
+      s3_bucket_name = "${local.account_name}-kinesis-flowlogs-portal-scheduler-s3"
+      log_stream_name = "SplunkDelivery_portal_scheduler"
+      kinesis_firehose_lambda_role_name = "KinesisFirehoseToLambaRole-portal_scheduler"
+      kinesis_firehose_role_name = "kinesis-firehose-role-name-portal-scheduler"
+      lambda_iam_policy_name = "Kinesis-Firehose-to-Splunk-Policy-portal_scheduler"
+      kinesis_firehose_iam_policy_name = "KinesisFirehose-Policy-portal_scheduler"
+      cloudwatch_to_firehose_trust_iam_role_name = "CloudWatchToSplunkFirehoseTrust-portal_scheduler"
+      cloudwatch_to_fh_access_policy_name = "KinesisCloudWatchToFirehosePolicy-portal_scheduler"
+    }
+  }
+
 }

+ 39 - 0
test/aws-us-gov/mdr-test-c2/370-moose-cloudwatch-logs/terragrunt.hcl

@@ -0,0 +1,39 @@
+locals {
+  # If you want to use any of the variables in _this_ file, you have to load them here.
+  # However, they will all be available as inputs to the module loaded in terraform.source
+  # below.
+
+  environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
+  partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
+  region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
+  account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
+  global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
+}
+
+# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
+# working directory, into a temporary folder, and execute your Terraform commands in that folder.
+terraform {
+  # Double slash is intentional and required to show root of modules
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/moose_cloudwatch_logs?ref=v3.5.7"
+}
+
+dependency "c2_account_standards" {
+  config_path = local.account_vars.locals.c2_account_standards_path
+}
+
+# Include all settings from the root terragrunt.hcl file
+include {
+  path = find_in_parent_folders()
+}
+
+# These are the variables we have to pass in to use the module specified in the terragrunt source above
+inputs = {
+  # All of the inputs from the inherited hcl files are available automatically
+  # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
+  # will be more flexible if you specify particular input values.
+  tags = {
+    Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
+  }
+}
+terraform_version_constraint = "= 1.0.7"
+terragrunt_version_constraint = "= 0.32.3"

+ 31 - 1
test/aws-us-gov/mdr-test-c2/account.hcl

@@ -242,4 +242,34 @@ locals {
 
   # Qualys Connector
   qualys_connector_externalid = "1601148045651" # Needs to come from the qualys console
-}
+
+  moose_cloudwatch_log_groups = {
+    "/aws/lambda/portal_customer_sync" = {
+      hec_token = "eb79bb2d-b27d-455d-bc5c-e8cf3165b294"
+      firehose_name = "portal_customer_sync_firehose"
+      lambda_function_name = "portal_customer_sync_kinesis_firehose_transform"
+      s3_bucket_name = "${local.account_name}-kinesis-flowlogs-portal-customer-sync-s3"
+      log_stream_name = "SplunkDelivery_portal_customer_sync"
+      kinesis_firehose_lambda_role_name = "KinesisFirehoseToLambaRole-portal_customer_sync"
+      kinesis_firehose_role_name = "kinesis-firehose-role-name-portal-customer-sync"
+      lambda_iam_policy_name = "Kinesis-Firehose-to-Splunk-Policy-portal_customer_sync"
+      kinesis_firehose_iam_policy_name = "KinesisFirehose-Policy-portal_customer_sync"
+      cloudwatch_to_firehose_trust_iam_role_name = "CloudWatchToSplunkFirehoseTrust-portal_customer_sync"
+      cloudwatch_to_fh_access_policy_name = "KinesisCloudWatchToFirehosePolicy-portal_customer_sync"
+    }
+    "/aws/lambda/portal_scheduler" = {
+      hec_token = "bce12568-f390-4b17-8dfe-ea26b856820b"
+      firehose_name = "portal_scheduler_firehose"
+      lambda_function_name = "portal_scheduler_kinesis_firehose_transform"
+      s3_bucket_name = "${local.account_name}-kinesis-flowlogs-portal-scheduler-s3"
+      log_stream_name = "SplunkDelivery_portal_scheduler"
+      kinesis_firehose_lambda_role_name = "KinesisFirehoseToLambaRole-portal_scheduler"
+      kinesis_firehose_role_name = "kinesis-firehose-role-name-portal-scheduler"
+      lambda_iam_policy_name = "Kinesis-Firehose-to-Splunk-Policy-portal_scheduler"
+      kinesis_firehose_iam_policy_name = "KinesisFirehose-Policy-portal_scheduler"
+      cloudwatch_to_firehose_trust_iam_role_name = "CloudWatchToSplunkFirehoseTrust-portal_scheduler"
+      cloudwatch_to_fh_access_policy_name = "KinesisCloudWatchToFirehosePolicy-portal_scheduler"
+    }
+  }
+  
+}