-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
173 lines (141 loc) · 7.16 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-aws-service-control-policies
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Copyrights
copyrights:
- name: "Cloud Posse, LLC"
url: "https://cloudposse.com"
year: "2020"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-service-control-policies
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-service-control-policies.svg"
url: "https://github.com/cloudposse/terraform-aws-service-control-policies/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
categories:
- scp
- policy
- policies
- service-control-policy
- service-control-policies
- aws
- organization
- ou
- organizational-unit
- iam
- iam-role
- account
# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: "terraform-aws-iam-role"
description: "A Terraform module that creates IAM role with provided JSON IAM polices documents."
url: "https://github.com/cloudposse/terraform-aws-iam-role"
- name: "terraform-aws-iam-policy-document-aggregator"
description: "Terraform module to aggregate multiple IAM policy documents into single policy document"
url: "https://github.com/cloudposse/terraform-aws-iam-policy-document-aggregator"
- name: "terraform-aws-iam-chamber-s3-role"
description: "Terraform module to provision an IAM role with configurable permissions to access S3 as chamber backend."
url: "https://github.com/cloudposse/terraform-aws-iam-chamber-s3-role"
- name: "terraform-yaml-config"
description: "Terraform module to convert local and remote YAML configuration templates into Terraform lists and maps."
url: "https://github.com/cloudposse/terraform-yaml-config"
# List any resources helpful for someone to get started. For example, link to the hashicorp documentation or AWS documentation.
references:
- name: "Service control policies"
description: "Service control policies (SCPs) are a type of organization policy that you can use to manage permissions in your organization."
url: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html"
- name: "Example service control policies"
description: "Examples of Service Control Policies (SCPs)."
url: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html"
- name: "SCP syntax"
description: "Service control policies (SCPs) use a similar syntax to that used by AWS Identity and Access Management (IAM) permission policies and resource-based policies."
url: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html"
- name: "Terraform Standard Module Structure"
description: "HashiCorp's standard module structure is a file and directory layout we recommend for reusable modules distributed in separate repositories."
url: "https://www.terraform.io/docs/modules/index.html#standard-module-structure"
- name: "Terraform Module Requirements"
description: "HashiCorp's guidance on all the requirements for publishing a module. Meeting the requirements for publishing a module is extremely easy."
url: "https://www.terraform.io/docs/registry/modules/publish.html#requirements"
- name: "Terraform `random_integer` Resource"
description: "The resource random_integer generates random values from a given range, described by the min and max attributes of a given resource."
url: "https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer"
- name: "Terraform Version Pinning"
description: "The required_version setting can be used to constrain which versions of the Terraform CLI can be used with your configuration"
url: "https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version"
- name: "SCPs size limits"
description: "The SCP have a size limit and creating many policies at once can result in a POLICY_CONTENT_LIMIT_EXCEEDED error"
url: "https://github.com/hashicorp/terraform-provider-aws/issues/12597"
# Short description of this project
description: |-
Terraform module to provision Service Control Policies (SCP) for AWS Organizations, Organizational Units, and AWS accounts.
# Introduction to the project
introduction: |-
Service Control Policies are configured in YAML configuration files.
We maintain a comprehensive [catalog](catalog) of SCP configurations and welcome contributions via pull request!
The [example](examples/complete) in this module uses the catalog to provision the SCPs on AWS.
The policies in the `catalog/*-templates` files require parameters supplied via the `parameters` input
to [terraform-yaml-config](https://github.com/cloudposse/terraform-yaml-config).
# How to use this module. Should be an easy example to copy and paste.
usage: |-
For a complete example, see [examples/complete](examples/complete).
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest)
(which tests and deploys the example on Datadog), see [test](test).
```hcl
module "yaml_config" {
source = "cloudposse/config/yaml"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
list_config_local_base_path = path.module
list_config_paths = ["catalog/*.yaml"]
context = module.this.context
}
module "yaml_config_with_parameters" {
source = "cloudposse/config/yaml"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
list_config_local_base_path = path.module
list_config_paths = ["https://raw.githubusercontent.com/cloudposse/terraform-aws-service-control-policies/0.12.0/catalog/s3-templates/DenyS3InNonSelectedRegion.yaml"]
parameters = {
"s3_regions_lockdown" = "us-*,eu-north-1"
}
context = module.this.context
}
data "aws_caller_identity" "this" {}
module "service_control_policies" {
source = "../../"
service_control_policy_statements = concat(module.yaml_config.list_configs, module.yaml_config_with_parameters.list_configs)
service_control_policy_description = var.service_control_policy_description
target_id = data.aws_caller_identity.this.account_id
context = module.this.context
}
```
# Example usage
examples: |-
Review the [complete example](examples/complete) to see how to use this module.
# How to get started quickly
#quickstart: |-
# Here's how to get started...
# Other files to include in this README from the project folder
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Andriy Knysh"
github: "aknysh"
- name: "PePe Amengual"
github: "jamengual"