Skip to content

Commit

Permalink
log related resources moved to their own file
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen James committed Jul 21, 2023
1 parent 210595f commit 5101a9b
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 69 deletions.
69 changes: 69 additions & 0 deletions logs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
module "log-forward" {
source = "./modules/log-forwarding"
prefix_name = module.label.id

subscriptions_config = {
production = {
destination_arn = var.production_kinesis_destination_arn,
log_groups = [
"Panorama-Policy-as-Code-codepipeline-log-group",
"Panorama-codepipeline-log-group",
"pttp-ci-infrastructure-admin-log-group-core",
"pttp-ci-infrastructure-aggregation-log-group-",
"pttp-ci-infrastructure-cloudtrail-log-group",
"pttp-ci-infrastructure-dns-dhcp-log-group-core",
"pttp-ci-infrastructure-dns-server-log-group-core",
"pttp-ci-infrastructure-ds-config-log-group-core",
"pttp-ci-infrastructure-kea-server-log-group-core",
"pttp-ci-infrastructure-log-group-core",
"pttp-ci-infrastructure-log-hc-log-group-core",
"pttp-ci-infrastructure-log-syslog-log-group-core",
"pttp-ci-infrastructure-pki-log-group-core",
"pttp-ci-infrastructure-snmp-log-group-core",
"pttp-ci-infrastructure-vpc-flow-logs-log-group",
"SOP-OCI-Access-codepipeline-log-group",
"TGW-codepipeline-log-group",
module.logging_heartbeat.production_log_group_name
]
},
pre_production = {
destination_arn = var.pre_production_kinesis_destination_arn,
log_groups = [
module.logging_heartbeat.pre_production_log_group_name
]
},
development = {
destination_arn = var.development_kinesis_destination_arn,
log_groups = [
module.logging_heartbeat.development_log_group_name
]
}
}
}

module "cloudtrail" {
source = "./modules/cloudtrail"
enable_cloudtrail_log_shipping_to_cloudwatch = var.enable_cloudtrail_log_shipping_to_cloudwatch
prefix = module.label.id
region = data.aws_region.current_region.id
tags = module.label.tags
}

module "vpc_flow_logs" {
source = "./modules/vpc_flow_logs"
prefix = module.label.id
region = data.aws_region.current_region.id
tags = module.label.tags
vpc_id = module.vpc.vpc_id
}

module "logging_heartbeat" {
source = "./modules/logging_heartbeat"
tags = module.label.tags
}

module "cloudwatch_exporter_role" {
source = "./modules/cloudwatch_exporter_role"

production_account_id = var.production_account_id
}
69 changes: 0 additions & 69 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -221,75 +221,6 @@ module "staff-infrastructure-smtp-relay-server" {
privileged_mode = true
}

module "log-forward" {
source = "./modules/log-forwarding"
prefix_name = module.label.id

subscriptions_config = {
production = {
destination_arn = var.production_kinesis_destination_arn,
log_groups = [
"Panorama-Policy-as-Code-codepipeline-log-group",
"Panorama-codepipeline-log-group",
"pttp-ci-infrastructure-admin-log-group-core",
"pttp-ci-infrastructure-aggregation-log-group-",
"pttp-ci-infrastructure-cloudtrail-log-group",
"pttp-ci-infrastructure-dns-dhcp-log-group-core",
"pttp-ci-infrastructure-dns-server-log-group-core",
"pttp-ci-infrastructure-ds-config-log-group-core",
"pttp-ci-infrastructure-kea-server-log-group-core",
"pttp-ci-infrastructure-log-group-core",
"pttp-ci-infrastructure-log-hc-log-group-core",
"pttp-ci-infrastructure-log-syslog-log-group-core",
"pttp-ci-infrastructure-pki-log-group-core",
"pttp-ci-infrastructure-snmp-log-group-core",
"pttp-ci-infrastructure-vpc-flow-logs-log-group",
"SOP-OCI-Access-codepipeline-log-group",
"TGW-codepipeline-log-group",
module.logging_heartbeat.production_log_group_name
]
},
pre_production = {
destination_arn = var.pre_production_kinesis_destination_arn,
log_groups = [
module.logging_heartbeat.pre_production_log_group_name
]
},
development = {
destination_arn = var.development_kinesis_destination_arn,
log_groups = [
module.logging_heartbeat.development_log_group_name
]
}
}
}

module "cloudtrail" {
source = "./modules/cloudtrail"
enable_cloudtrail_log_shipping_to_cloudwatch = var.enable_cloudtrail_log_shipping_to_cloudwatch
prefix = module.label.id
region = data.aws_region.current_region.id
tags = module.label.tags
}

module "vpc_flow_logs" {
source = "./modules/vpc_flow_logs"
prefix = module.label.id
region = data.aws_region.current_region.id
tags = module.label.tags
vpc_id = module.vpc.vpc_id
}

module "logging_heartbeat" {
source = "./modules/logging_heartbeat"
tags = module.label.tags
}

module "cloudwatch_exporter_role" {
source = "./modules/cloudwatch_exporter_role"

production_account_id = var.production_account_id
}
resource "aws_codestarconnections_connection" "nvvs-github-connection" {
name = "nvvs github connection"
provider_type = "GitHub"
Expand Down

0 comments on commit 5101a9b

Please sign in to comment.