-
Notifications
You must be signed in to change notification settings - Fork 6
/
kms.tf
29 lines (26 loc) · 982 Bytes
/
kms.tf
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
resource "aws_kms_key" "runtask_key" {
description = "KMS key for Run Task integration"
policy = data.aws_iam_policy_document.runtask_key.json
enable_key_rotation = true
tags = local.combined_tags
}
# Assign an alias to the key
resource "aws_kms_alias" "runtask_key" {
name = "alias/RunTaskIA2"
target_key_id = aws_kms_key.runtask_key.key_id
}
resource "aws_kms_key" "runtask_waf" {
count = local.waf_deployment
provider = aws.cloudfront_waf
description = "KMS key for WAF"
policy = data.aws_iam_policy_document.runtask_waf[count.index].json
enable_key_rotation = true
tags = local.combined_tags
}
# Assign an alias to the key
resource "aws_kms_alias" "runtask_waf" {
count = local.waf_deployment
provider = aws.cloudfront_waf
name = "alias/RunTaskIA2-WAF"
target_key_id = aws_kms_key.runtask_waf[count.index].key_id
}