Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Amazonka.Organizations.AttachPolicy
Description
Attaches a policy to a root, an organizational unit (OU), or an individual account. How the policy affects accounts depends on the type of policy. Refer to the AWS Organizations User Guide for information about each policy type:
This operation can be called only from the organization's management account.
Synopsis
Creating a Request
data AttachPolicy Source #
See: newAttachPolicy
smart constructor.
Constructors
AttachPolicy' | |
Fields
|
Instances
Create a value of AttachPolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:policyId:AttachPolicy'
, attachPolicy_policyId
- The unique identifier (ID) of the policy that you want to attach to the
target. You can get the ID for the policy by calling the ListPolicies
operation.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).
$sel:targetId:AttachPolicy'
, attachPolicy_targetId
- The unique identifier (ID) of the root, OU, or account that you want to
attach the policy to. You can get the ID by calling the ListRoots,
ListOrganizationalUnitsForParent, or ListAccounts operations.
The regex pattern for a target ID string requires one of the following:
- Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
- Account - A string that consists of exactly 12 digits.
- Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
Request Lenses
attachPolicy_policyId :: Lens' AttachPolicy Text Source #
The unique identifier (ID) of the policy that you want to attach to the target. You can get the ID for the policy by calling the ListPolicies operation.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).
attachPolicy_targetId :: Lens' AttachPolicy Text Source #
The unique identifier (ID) of the root, OU, or account that you want to attach the policy to. You can get the ID by calling the ListRoots, ListOrganizationalUnitsForParent, or ListAccounts operations.
The regex pattern for a target ID string requires one of the following:
- Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
- Account - A string that consists of exactly 12 digits.
- Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
Destructuring the Response
data AttachPolicyResponse Source #
See: newAttachPolicyResponse
smart constructor.
Constructors
AttachPolicyResponse' | |
Instances
newAttachPolicyResponse :: AttachPolicyResponse Source #
Create a value of AttachPolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.