-
Notifications
You must be signed in to change notification settings - Fork 4
/
secrets.tf
37 lines (31 loc) · 1.46 KB
/
secrets.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
34
35
36
37
#####################################################################################
# SECRETS MANAGER
#####################################################################################
resource "random_uuid" "runtask_hmac" {}
resource "aws_secretsmanager_secret" "runtask_hmac" {
#checkov:skip=CKV2_AWS_57:run terraform apply to rotate hmac
name = "${local.solution_prefix}-runtask-hmac"
recovery_window_in_days = var.recovery_window
kms_key_id = aws_kms_key.runtask_key.arn
tags = local.combined_tags
}
resource "aws_secretsmanager_secret_version" "runtask_hmac" {
secret_id = aws_secretsmanager_secret.runtask_hmac.id
secret_string = random_uuid.runtask_hmac.result
}
resource "random_uuid" "runtask_cloudfront" {
count = local.waf_deployment
}
resource "aws_secretsmanager_secret" "runtask_cloudfront" {
#checkov:skip=CKV2_AWS_57:run terraform apply to rotate cloudfront secret
count = local.waf_deployment
name = "${local.solution_prefix}-runtask_cloudfront"
recovery_window_in_days = var.recovery_window
kms_key_id = aws_kms_key.runtask_key.arn
tags = local.combined_tags
}
resource "aws_secretsmanager_secret_version" "runtask_cloudfront" {
count = local.waf_deployment
secret_id = aws_secretsmanager_secret.runtask_cloudfront[count.index].id
secret_string = random_uuid.runtask_cloudfront[count.index].result
}