Skip to content

Commit 727b400

Browse files
author
AWS
committed
Release: 1.15.1
1 parent 49bb3d4 commit 727b400

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.15.0
1+
1.15.1

modules/aft-account-request-framework/ddb.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ resource "aws_dynamodb_table" "aft_request_metadata" {
2525
global_secondary_index {
2626
name = "typeIndex"
2727
hash_key = "type"
28-
write_capacity = 1
29-
read_capacity = 1
3028
projection_type = "ALL"
3129
}
3230

3331
global_secondary_index {
3432
name = "emailIndex"
3533
hash_key = "email"
36-
write_capacity = 1
37-
read_capacity = 1
3834
projection_type = "INCLUDE"
3935
non_key_attributes = ["id"]
4036
}

modules/aft-account-request-framework/kms.tf

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@
44
resource "aws_kms_key" "aft" {
55
description = "AFT KMS key"
66
enable_key_rotation = "true"
7-
}
8-
9-
resource "aws_kms_alias" "aft" {
10-
name = "alias/aft"
11-
target_key_id = aws_kms_key.aft.key_id
12-
}
13-
14-
resource "aws_kms_key_policy" "aft" {
15-
key_id = aws_kms_key.aft.id
7+
# Use inline policy instead of 'aws_kms_key_policy' resource
8+
# to always make sure policy is fully propagated before the key is used
9+
# e.g. for CloudWatch Log Groups
1610
policy = jsonencode(
1711
{
1812
"Version" : "2012-10-17",
1913
"Id" : "key-default-1",
20-
"Statement" : [
14+
"Statement" : concat([
2115
{
2216
"Sid" : "Enable IAM User Permissions",
2317
"Effect" : "Allow",
@@ -26,10 +20,8 @@ resource "aws_kms_key_policy" "aft" {
2620
},
2721
"Action" : "kms:*",
2822
"Resource" : "*"
29-
},
30-
# Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html
31-
{
32-
"Sid" : "Allow CloudWatch Logs access",
23+
}], var.cloudwatch_log_group_enable_cmk_encryption ? [{
24+
"Sid" : "Allow CloudWatch Logs access", # Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html
3325
"Effect" : "Allow",
3426
"Principal" : {
3527
"Service" : "logs.${data.aws_region.aft-management.name}.amazonaws.com"
@@ -48,8 +40,12 @@ resource "aws_kms_key_policy" "aft" {
4840
"kms:EncryptionContext:aws:logs:arn" : "arn:${data.aws_partition.current.partition}:logs:${data.aws_region.aft-management.name}:${data.aws_caller_identity.aft-management.account_id}:*"
4941
}
5042
}
51-
}
52-
]
53-
}
54-
)
43+
}] : [])
44+
})
45+
}
46+
47+
48+
resource "aws_kms_alias" "aft" {
49+
name = "alias/aft"
50+
target_key_id = aws_kms_key.aft.key_id
5551
}

0 commit comments

Comments
 (0)