Sub topic 2
Authorization policy types and enabling them
This chapter assumes you have used IAM identity-based policies and read policy JSON. It also assumes you have run basic AWS CLI commands and know what a root, an OU, and a member account are in an organization.
Two families of policies
AWS Organizations supports several policy types. They fall into two families:
- Authorization policies control what is permitted. They are service control policies (SCPs) and resource control policies (RCPs).
- Management policies standardize configuration or behavior, such as tag policies and backup policies. They do not set permission limits.
This tutorial covers the authorization policies.
| Type | Limits permissions of | CLI policy type value |
|---|---|---|
| SCP | Principals (IAM users and roles) in member accounts | `SERVICE_CONTROL_POLICY` |
| RCP | Resources in member accounts | `RESOURCE_CONTROL_POLICY` |
Neither type grants access. Each sets a ceiling, and a request still needs an allow from IAM policies to succeed. Later chapters cover the evaluation details.
Why enabling comes first
A policy type must be enabled on the organization root before you can attach any policy of that type. Enablement is per root and per type. Two requirements apply:
- The organization must have all features turned on. An organization that only uses consolidated billing cannot use SCPs or RCPs.
- You enable policy types from the management account, or from a delegated administrator where AWS allows it.
When you enable SCPs, AWS attaches its managed FullAWSAccess policy to the root, every OU, and every account. This policy allows all actions, so nothing changes until you add restrictions. Enabling RCPs works the same way with the managed RCPFullAWSAccess policy. Existing behavior is preserved.
Enabling the types with the CLI
First find the root ID. Then enable each type on it.
# Find the root ID, then enable both policy types on it
aws organizations list-roots
aws organizations enable-policy-type \
--root-id r-examplerootid \
--policy-type SERVICE_CONTROL_POLICY
aws organizations enable-policy-type \
--root-id r-examplerootid \
--policy-type RESOURCE_CONTROL_POLICYReplace r-examplerootid with the ID that list-roots returns. To confirm the result, print the root's policy types:
aws organizations list-roots \
--query 'Roots[].{Id:Id,PolicyTypes:PolicyTypes}'Each type appears with a status. ENABLED means you can attach policies of that type. PENDING_ENABLE and PENDING_DISABLE are short transitional states.
Disabling has side effects
Common errors
PolicyTypeNotEnabledExceptionwhen attaching a policy. The type is not enabled on the root that contains the target. Enable it first.PolicyTypeNotAvailableForOrganizationExceptionwhen enabling. The organization has only consolidated billing features. Enable all features first.AccessDeniedExceptionwhen running these commands from a member account. Run them from the management account, or from a delegated administrator that has the right permissions.- Wrong root ID. Root IDs start with
r-. OU IDs start withou-and account IDs are 12 digits. Passing the wrong kind of ID to--root-idfails.
What comes next
With the types enabled, you can create policies and attach them to the root, OUs, or accounts. The next chapter shows how attachment and inheritance combine those policies.
Exercise
You run aws organizations attach-policy with an RCP and get PolicyTypeNotEnabledException. Your SCPs already work. What do you do, and what does AWS attach automatically when you do it?
Show answer
Enable the RCP type on the root with aws organizations enable-policy-type --root-id <root-id> --policy-type RESOURCE_CONTROL_POLICY, then retry the attach. SCP and RCP types are enabled separately, so SCPs working does not imply RCPs are enabled. Enabling RCPs attaches the managed RCPFullAWSAccess policy, which allows everything, so existing access is unchanged until you add restrictions.