|
@@ -17,6 +17,8 @@ module "ebs_root_encrypt_decrypt" {
|
|
|
aws_account_id = var.aws_account_id
|
|
|
aws_partition = var.aws_partition
|
|
|
is_legacy = var.is_legacy
|
|
|
+
|
|
|
+ depends_on = [ aws_iam_service_linked_role.AWSServiceRoleForAutoScaling ]
|
|
|
}
|
|
|
|
|
|
# Note: The following wasn't configured in tf11
|
|
@@ -27,3 +29,22 @@ resource "aws_ebs_default_kms_key" "ebs_root_encrypt_decrypt" {
|
|
|
resource "aws_ebs_encryption_by_default" "encryptbydefault" {
|
|
|
enabled = true
|
|
|
}
|
|
|
+
|
|
|
+resource "aws_kms_grant" "ASG_access_to_EBS_Default_CMK" {
|
|
|
+ name = "ASG_access_to_EBS_Default_CMK"
|
|
|
+ key_id = module.ebs_root_encrypt_decrypt.key_arn
|
|
|
+ grantee_principal = aws_iam_service_linked_role.AWSServiceRoleForAutoScaling.arn
|
|
|
+ operations = [
|
|
|
+ "Decrypt",
|
|
|
+ "Encrypt",
|
|
|
+ "GenerateDataKey",
|
|
|
+ "GenerateDataKeyWithoutPlaintext",
|
|
|
+ "ReEncryptFrom",
|
|
|
+ "ReEncryptTo",
|
|
|
+ "CreateGrant",
|
|
|
+ "RetireGrant",
|
|
|
+ "DescribeKey",
|
|
|
+ ]
|
|
|
+
|
|
|
+ depends_on = [ aws_iam_service_linked_role.AWSServiceRoleForAutoScaling ]
|
|
|
+}
|