Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up prerequisites to push logs from core-vpc into core-logging S3 bucket #7749

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion terraform/environments/core-logging/cortex.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ resource "aws_secretsmanager_secret" "logging" {
# checkov:skip=CKV2_AWS_57
provider = aws.modernisation-platform
kms_key_id = data.aws_kms_alias.secrets.target_key_id
name = "core-logging-bucket-arn"
name = "core_logging_bucket_arn"
recovery_window_in_days = 0
tags = local.tags
}
Expand Down
2 changes: 2 additions & 0 deletions terraform/environments/core-vpc/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ locals {

# Secrets used by Firehose resources which we only require for development & production VPCs.
xsiam = jsondecode(data.aws_secretsmanager_secret_version.xsiam_secret_arn_version.secret_string)
cloudwatch_log_groups = local.is-production ? [ for env in module.route_53_resolver_logs : env.r53_resolver_log_name ] : []
cloudwatch_logging_bucket = data.aws_secretsmanager_secret_version.core_logging_bucket_arn.secret_string

tags = {
business-unit = "Platforms"
Expand Down
9 changes: 9 additions & 0 deletions terraform/environments/core-vpc/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ data "aws_secretsmanager_secret_version" "pagerduty_integration_keys" {
secret_id = data.aws_secretsmanager_secret.pagerduty_integration_keys.id
}

data "aws_secretsmanager_secret" "core_logging_bucket_arn" {
provider = aws.modernisation-platform
name = "core_logging_bucket_arn"
}

data "aws_secretsmanager_secret_version" "core_logging_bucket_arn" {
provider = aws.modernisation-platform
secret_id = data.aws_secretsmanager_secret.core_logging_bucket_arn.id
}

# Data for Firehose Endpoint URL & Key that are held in secrets manager.

Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/core-vpc/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ locals {
module "vpc" {
for_each = local.vpcs[terraform.workspace]

source = "github.com/ministryofjustice/modernisation-platform-terraform-member-vpc?ref=ddcd36b717b937bfa72b6245fd0410861aa40b36" # v2.3.0
source = "github.com/ministryofjustice/modernisation-platform-terraform-member-vpc?ref=3094604aee5121f9794d60d3f27d21d6209e59d4" # v2.4.0

subnet_sets = { for key, subnet in each.value.cidr.subnet_sets : key => subnet.cidr }

Expand Down