Smaws_Client_Organizations.DetachPolicyDetaches a policy from a target root, organizational unit (OU), or account.
If the policy being detached is a service control policy (SCP), the changes to permissions for Identity and Access Management (IAM) users and roles in affected accounts are immediate.
Every root, OU, and account must have at least one SCP attached. If you want to replace the default FullAWSAccess policy with an SCP that limits the permissions that can be delegated, you must attach the replacement SCP before you can remove the default SCP. This is the authorization strategy of an "allow list". If you instead attach a second SCP and leave the FullAWSAccess SCP still attached, and specify "Effect": "Deny" in the second SCP to override the "Effect": "Allow" in the FullAWSAccess policy (or any other attached SCP), you're using the authorization strategy of a "deny list".
You can only call this operation from the management account or a member account that is a delegated administrator.
val error_to_string :
[ Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `AWSOrganizationsNotInUseException of
Types.aws_organizations_not_in_use_exception
| `ConcurrentModificationException of Types.concurrent_modification_exception
| `ConstraintViolationException of Types.constraint_violation_exception
| `InvalidInputException of Types.invalid_input_exception
| `PolicyChangesInProgressException of
Types.policy_changes_in_progress_exception
| `PolicyNotAttachedException of Types.policy_not_attached_exception
| `PolicyNotFoundException of Types.policy_not_found_exception
| `ServiceException of Types.service_exception
| `TargetNotFoundException of Types.target_not_found_exception
| `TooManyRequestsException of Types.too_many_requests_exception
| `UnsupportedAPIEndpointException of
Types.unsupported_api_endpoint_exception ] ->
stringval request :
'http_type Smaws_Lib.Context.t ->
Types.detach_policy_request ->
(Smaws_Lib.Smithy_api.Types.unit_,
[> Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `AWSOrganizationsNotInUseException of
Types.aws_organizations_not_in_use_exception
| `ConcurrentModificationException of
Types.concurrent_modification_exception
| `ConstraintViolationException of Types.constraint_violation_exception
| `InvalidInputException of Types.invalid_input_exception
| `PolicyChangesInProgressException of
Types.policy_changes_in_progress_exception
| `PolicyNotAttachedException of Types.policy_not_attached_exception
| `PolicyNotFoundException of Types.policy_not_found_exception
| `ServiceException of Types.service_exception
| `TargetNotFoundException of Types.target_not_found_exception
| `TooManyRequestsException of Types.too_many_requests_exception
| `UnsupportedAPIEndpointException of
Types.unsupported_api_endpoint_exception ])
Stdlib.resultval request_with_metadata :
'http_type Smaws_Lib.Context.t ->
Types.detach_policy_request ->
(Smaws_Lib.Smithy_api.Types.unit_ Smaws_Lib.Response.t,
[> Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `AWSOrganizationsNotInUseException of
Types.aws_organizations_not_in_use_exception
| `ConcurrentModificationException of
Types.concurrent_modification_exception
| `ConstraintViolationException of Types.constraint_violation_exception
| `InvalidInputException of Types.invalid_input_exception
| `PolicyChangesInProgressException of
Types.policy_changes_in_progress_exception
| `PolicyNotAttachedException of Types.policy_not_attached_exception
| `PolicyNotFoundException of Types.policy_not_found_exception
| `ServiceException of Types.service_exception
| `TargetNotFoundException of Types.target_not_found_exception
| `TooManyRequestsException of Types.too_many_requests_exception
| `UnsupportedAPIEndpointException of
Types.unsupported_api_endpoint_exception ]
* Smaws_Lib.Response.metadata)
Stdlib.result