Skip to content

Commit 38f25ae

Browse files
authored
readme (#7)
readme updates
1 parent 02af7d7 commit 38f25ae

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
## terraform-aws-organization-policies
22

3-
Deploy SCPs, RCPs, and other AWS Organization policies with Terraform.
3+
Deploy SCPs, RCPs, and other AWS [organization policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html) with Terraform.
44

55
## Module Inputs
66
SCP example:
77
```hcl
88
module "scps" {
99
source = "aws-samples/organization-policies/aws"
10-
version = "3.0.1"
10+
version = "3.1.0"
1111
policy_type = "SERVICE_CONTROL_POLICY"
1212
ou_map = {
1313
"r-1xyz" = ["root", "allow_services"] #root
@@ -20,17 +20,17 @@ RCP example:
2020
```hcl
2121
module "rcps" {
2222
source = "aws-samples/organization-policies/aws"
23-
version = "3.0.1"
23+
version = "3.1.0"
2424
policy_type = "RESOURCE_CONTROL_POLICY"
2525
ou_map = {
2626
"r-1xyz" = ["root"] #root
2727
}
2828
}
2929
```
3030

31-
`policy_type` is the type of organizational policy. Valid values are `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `RESOURCE_CONTROL_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`. A new module needs to be created for each policy type.
31+
`policy_type` is the type of organizational policy. A new module needs to be created for each policy type.
3232

33-
`ou_map` is a map of OU IDs and the policies attached to them. Policies are stored as JSON files in an adjacent directory. The directory name defaults to the policy type, eg `./service_control_policy/`.
33+
`ou_map` is a map of OU IDs and the policies attached to them. Policies are stored as `json` files in an adjacent directory. The directory name defaults to the policy type, eg `./service_control_policy/`.
3434

3535
The above two module inputs would look like this:
3636
```
@@ -54,7 +54,26 @@ module "scps" {
5454
}
5555
```
5656

57-
`policies_directory` can be used to change the name and location of the directory used to store policies. Otherwise it will default to the name of the policy type, eg `./service_control_policy/`.
57+
`policies_directory` overrides the name and location of the directory used to store policies. Otherwise it will default to the name of the policy type, eg `./service_control_policy/`.
58+
59+
### Template Files
60+
61+
The module accepts template files (`.json.tpl`). These can be inputted alongside `json` files.
62+
```hcl
63+
module "scps" {
64+
source = "aws-samples/organization-policies/aws"
65+
version = "3.1.0"
66+
policy_type = "SERVICE_CONTROL_POLICY"
67+
ou_map = {
68+
"r-1xyz" = ["root", "iam"] #root
69+
}
70+
template_variables = {
71+
management_account_id = var.management_account_id
72+
}
73+
}
74+
```
75+
`template_variables` inserts variables into template files. See [iam.json.tpl](./service_control_policy/iam.json.tpl) for an example.
76+
5877

5978
## Troubleshooting
6079

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Sid": "IAM",
6+
"Effect": "Deny",
7+
"Action": [
8+
"iam:AttachRolePolicy",
9+
"iam:CreateRole",
10+
"iam:Delete*",
11+
"iam:DetachRolePolicy",
12+
"iam:Put*",
13+
"iam:Update*",
14+
"iam:TagRole",
15+
"iam:UntagRole"
16+
],
17+
"Resource": "*",
18+
"Condition": {
19+
"ArnNotLike": {
20+
"aws:PrincipalARN": [
21+
"arn:aws:iam::*:role/AWSControlTowerExecution",
22+
"arn:aws:iam::${management_account_id}:role/AWSAFTAdmin"
23+
]
24+
}
25+
}
26+
}
27+
]
28+
}

0 commit comments

Comments
 (0)