-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodule_logging_bucket.tf
More file actions
35 lines (28 loc) · 972 Bytes
/
module_logging_bucket.tf
File metadata and controls
35 lines (28 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module "logging_bucket" {
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v2.0.17"
name = "bucket-logs"
aws_account_id = var.aws_account_id
component = var.component
environment = var.environment
project = var.project
region = var.region
default_tags = merge(local.default_tags, { "Enable-Backup" = var.enable_backups }, { "Enable-S3-Continuous-Backup" = var.enable_backups }, { "SKIP_S3_AUDIT" = "true" })
kms_key_arn = module.kms.key_id
policy_documents = [
data.aws_iam_policy_document.logging.json
]
}
data "aws_iam_policy_document" "logging" {
statement {
sid = "s3-log-delivery"
effect = "Allow"
principals {
type = "Service"
identifiers = ["logging.s3.amazonaws.com"]
}
actions = ["s3:PutObject"]
resources = [
"${module.logging_bucket.arn}/*",
]
}
}