-
Notifications
You must be signed in to change notification settings - Fork 4
/
kms.tf
33 lines (29 loc) · 1.13 KB
/
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
30
31
32
33
#####################################################################################
# KMS
#####################################################################################
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/runTask"
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/runtask-WAF"
target_key_id = aws_kms_key.runtask_waf[count.index].key_id
}