From d2ff6f38f0f16a14f66714cb2ea8778c332af89c Mon Sep 17 00:00:00 2001 From: mynampatinaveen Date: Mon, 9 Sep 2024 15:29:18 +0100 Subject: [PATCH] Update kms.tf --- modules/products/static-site/kms.tf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/products/static-site/kms.tf b/modules/products/static-site/kms.tf index 1b991b3..fa9bf68 100644 --- a/modules/products/static-site/kms.tf +++ b/modules/products/static-site/kms.tf @@ -4,6 +4,7 @@ resource "aws_kms_key" "static_site_kms" { } resource "aws_kms_key_policy" "static_site_kms_policy" { +key_id = aws_kms_key.static_site_kms.id policy = jsonencode({ Version = "2012-10-17" Id = "static_site_kms_policy" @@ -19,13 +20,8 @@ resource "aws_kms_key_policy" "static_site_kms_policy" { Principal = { type = "Service" identifiers = ["cloudfront.amazonaws.com"] - } + }, Resource = ["*"] - condition = { - test = "StringEquals" - variable = "aws:SourceArn" - values = [aws_cloudfront_distribution.static_site_distribution.arn] - } }, ] })