enablePolicyType
Enables a policy type in a root. After you enable a policy type in a root, you can attach policies of that type to the root, any organizational unit (OU), or account in that root. You can undo this by using the DisablePolicyType operation.
This is an asynchronous request that Amazon Web Services performs in the background. Amazon Web Services recommends that you first use ListRoots to see the status of policy types for a specified root, and then use this operation.
This operation can be called only from the organization's management account or by a member account that is a delegated administrator for an Amazon Web Services service.
You can enable a policy type in a root only if that policy type is available in the organization. To view the status of available policy types in the organization, use DescribeOrganization.
Samples
fun main() {
//sampleStart
// The following example shows how to enable the service control policy (SCP) policy type in a root.
// The output shows a root object with a PolicyTypes response element showing that SCPs are now enabled n
// n
val resp = organizationsClient.enablePolicyType {
rootId = "r-examplerootid111"
policyType = PolicyType.fromValue("SERVICE_CONTROL_POLICY")
}
//sampleEnd
}