You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
## terraform-aws-organization-policies
2
2
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.
4
4
5
5
## Module Inputs
6
6
SCP example:
7
7
```hcl
8
8
module "scps" {
9
9
source = "aws-samples/organization-policies/aws"
10
-
version = "3.0.1"
10
+
version = "3.1.0"
11
11
policy_type = "SERVICE_CONTROL_POLICY"
12
12
ou_map = {
13
13
"r-1xyz" = ["root", "allow_services"] #root
@@ -20,17 +20,17 @@ RCP example:
20
20
```hcl
21
21
module "rcps" {
22
22
source = "aws-samples/organization-policies/aws"
23
-
version = "3.0.1"
23
+
version = "3.1.0"
24
24
policy_type = "RESOURCE_CONTROL_POLICY"
25
25
ou_map = {
26
26
"r-1xyz" = ["root"] #root
27
27
}
28
28
}
29
29
```
30
30
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.
32
32
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/`.
34
34
35
35
The above two module inputs would look like this:
36
36
```
@@ -54,7 +54,26 @@ module "scps" {
54
54
}
55
55
```
56
56
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.
0 commit comments