Skip to content

Commit

Permalink
Merge pull request #9460 from ministryofjustice/revert-pr-9263
Browse files Browse the repository at this point in the history
Reverts 9263
  • Loading branch information
Khatraf authored Mar 4, 2025
2 parents 3dcfc07 + 46d1474 commit f9ccfc6
Showing 1 changed file with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,43 +0,0 @@
# Variable to allow bucket selection
variable "buckets_to_protect" {
description = <<EOF
Enter the pre-existing bucket names you want to enable malware protection for.
Bucket names must be separated by commas (e.g., bucket1,bucket2,bucket3).
To enable for all buckets, list all bucket names here.
EOF
type = string
default = "mod-platform-image-artefact-bucket20230203091453221500000001,modernisation-platform-software20230224000709766100000001"
}

# Define the list of buckets to protect
locals {
bucket_list = toset(split(",", replace(trimspace(var.buckets_to_protect), " ", "")))
}

# GuardDuty Malware Protection Plan
resource "aws_guardduty_malware_protection_plan" "malware_protection_plan" {
for_each = local.bucket_list

role = data.aws_iam_role.mp_access.arn

protected_resource {
s3_bucket {
bucket_name = each.key
}
}

actions {
tagging {
status = "ENABLED"
}
}

tags = {
"Name" = "GuardDutyMalwareProtectionPlan-${each.key}" # Unique tag for each bucket
}
}


data "aws_iam_role" "mp_access" {
name = "ModernisationPlatformAccess"
}

0 comments on commit f9ccfc6

Please sign in to comment.