Skip to content

Commit

Permalink
Create bucket and log group for terraform-managed lambdas.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Grayson committed Sep 12, 2023
1 parent 3ad591c commit 515aadf
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
3 changes: 1 addition & 2 deletions infrastructure/cloudtrail.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ resource "aws_cloudtrail" "all-events" {
}

resource "aws_s3_bucket" "cloudtrail_bucket" {
bucket = var.cloudtrail_bucket_name
force_destroy = true
bucket = var.cloudtrail_bucket_name
tags = {
Project = var.project
Stage = var.stage
Expand Down
17 changes: 17 additions & 0 deletions infrastructure/infrastructure.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "aws_s3_bucket" "infrastructure" {
name = var.infrastructure_bucket_name
tags = {
Project = var.project
Stage = var.stage
}
}

resource "aws_cloudwatch_log_group" "infrastructure" {
name = var.infrastructure_log_group_name
retention_in_days = 3653
kms_key_id = aws_kms_key.key.arn
tags = {
Project = var.project
Stage = var.stage
}
}
2 changes: 2 additions & 0 deletions infrastructure/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ cloudtrail_bucket_name = "cisa-crossfeed-prod-cloudtrail"
cloudtrail_role_name = "cisa-crossfeed-prod-cloudtrail"
cloudtrail_log_group_name = "cisa-crossfeed-prod-cloudtrail"
export_bucket_name = "cisa-crossfeed-prod-exports"
infrastructure_bucket_name = "cisa-crossfeed-prod-infrastructure"
infrastructure_log_group_name = "cisa-crossfeed-prod-infrastructure"
reports_bucket_name = "cisa-crossfeed-prod-reports"
pe_db_backups_bucket_name = "cisa-crossfeed-prod-pe-db-backups"
user_pool_name = "crossfeed-prod"
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/stage.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ cloudtrail_bucket_name = "cisa-crossfeed-staging-cloudtrail"
cloudtrail_role_name = "cisa-crossfeed-staging-cloudtrail"
cloudtrail_log_group_name = "cisa-crossfeed-staging-cloudtrail"
export_bucket_name = "cisa-crossfeed-staging-exports"
infrastructure_bucket_name = "cisa-crossfeed-staging-infrastructure"
infrastructure_log_group_name = "cisa-crossfeed-staging-infrastructure"
reports_bucket_name = "cisa-crossfeed-staging-reports"
pe_db_backups_bucket_name = "cisa-crossfeed-staging-pe-db-backups"
user_pool_name = "crossfeed-staging"
Expand Down
12 changes: 12 additions & 0 deletions infrastructure/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,18 @@ variable "export_bucket_name" {
default = "cisa-crossfeed-staging-exports"
}

variable "infrastructure_bucket_name" {
description = "infrastructure_bucket_name"
type = string
default = "cisa-crossfeed-staging-infrastructure"
}

variable "infrastructure_log_group_name" {
description = "infrastructure_log_group_name"
type = string
default = "crossfeed-staging-infrastructure-logs"
}

variable "reports_bucket_name" {
description = "reports_bucket_name"
type = string
Expand Down

0 comments on commit 515aadf

Please sign in to comment.