Skip to content

Commit 2d3d2d5

Browse files
authored
Added sample way of using this module
1 parent c58a71d commit 2d3d2d5

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# terraform-aws-kms-share-multi-accounts
2-
module to create kms key and share the access to multi accounts with IAM and Users
1+
# *Terraform-aws-kms-share-multi-accounts*
2+
module to create custom kms key and share access to multiple AWS accounts with option to add particular IAM Roles and Users
3+
## Sample way of using this module
4+
> There are 2 ways to use this module.
5+
6+
1. Using default policy to create kms key and share to dest accounts
7+
8+
```
9+
module "kms_sharing" {
10+
source = "[email protected]:devops-made-easy/terraform-aws-kms-share-multi-accounts.git"
11+
version = "1.0.0"
12+
key_name = "devops-key-sharing"
13+
dest_account_ids = ["1111111", "222222", "333333"]
14+
dest_iam_roles = ["arn:aws:iam::xxxxxx:role/dest_iam_role"](optional)
15+
src_account_ids = ["444444"]
16+
src_iam_roles = ["arn:aws:iam::xxxxxx:role/src_iam_role"](optional)
17+
}
18+
```
19+
2. Using Custom policy provided to this module
20+
```
21+
module "kms_sharing" {
22+
source = "[email protected]:devops-made-easy/terraform-aws-kms-share-multi-accounts.git"
23+
version = "1.0.0"
24+
key_name = "devops-key-sharing"
25+
dest_account_ids = ["1111111", "222222", "333333"]
26+
dest_iam_roles = ["arn:aws:iam::xxxxxx:role/dest_iam_role"](optional)
27+
src_account_ids = ["444444"]
28+
src_iam_roles = ["arn:aws:iam::xxxxxx:role/src_iam_role"](optional)
29+
user_policy = file("${path.module}/xxxx.json.tpl")(optional)
30+
}
31+
```

0 commit comments

Comments
 (0)