Skip to content

Commit

Permalink
encrypted true
Browse files Browse the repository at this point in the history
  • Loading branch information
yadavprakash committed May 21, 2021
1 parent 04a0e31 commit 4629c8d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions _example/basic_example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,36 @@ module "iam-role" {
policy = data.aws_iam_policy_document.iam-policy.json
}

module "kms_key" {
source = "clouddrove/kms/aws"
version = "0.14.0"
name = "kms"
environment = "test"
label_order = ["environment", "name"]
enabled = true
description = "KMS key for ec2"
deletion_window_in_days = 7
enable_key_rotation = true
alias = "alias/ec2"
policy = data.aws_iam_policy_document.kms.json
}


data "aws_iam_policy_document" "kms" {
version = "2012-10-17"
statement {
sid = "Enable IAM User Permissions"
effect = "Allow"
principals {
type = "AWS"
identifiers = ["*"]
}
actions = ["kms:*"]
resources = ["*"]
}

}

data "aws_iam_policy_document" "default" {
statement {
effect = "Allow"
Expand Down Expand Up @@ -127,4 +157,5 @@ module "ec2" {
instance_tags = { "snapshot" = true }
dns_zone_id = "Z1XJD7SSBKXLC1"
hostname = "ec2"
kms_key_id = module.kms_key.key_arn
}
1 change: 1 addition & 0 deletions _example/secure_example/.terraform.tfstate.lock.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ID":"10b22222-f684-fe9c-141c-5a5d2e87bc2e","Operation":"OperationTypePlan","Info":"","Who":"prakash@prakash","Version":"0.14.7","Created":"2021-05-21T09:51:33.101568919Z","Path":"terraform.tfstate"}

0 comments on commit 4629c8d

Please sign in to comment.