libZSservicesZSamazonka-organizationsZSamazonka-organizations
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

  • policyId :: Text

    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 (_).

  • targetId :: Text

    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.

Instances

Instances details
Eq AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Read AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Show AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Generic AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Associated Types

type Rep AttachPolicy :: Type -> Type #

NFData AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Methods

rnf :: AttachPolicy -> () #

Hashable AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

ToJSON AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

AWSRequest AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Associated Types

type AWSResponse AttachPolicy #

ToHeaders AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

ToPath AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

ToQuery AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

type Rep AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

type Rep AttachPolicy = D1 ('MetaData "AttachPolicy" "Amazonka.Organizations.AttachPolicy" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "AttachPolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "targetId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse AttachPolicy Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

newAttachPolicy Source #

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

Instances details
Eq AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Read AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Show AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Generic AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Associated Types

type Rep AttachPolicyResponse :: Type -> Type #

NFData AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

Methods

rnf :: AttachPolicyResponse -> () #

type Rep AttachPolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.AttachPolicy

type Rep AttachPolicyResponse = D1 ('MetaData "AttachPolicyResponse" "Amazonka.Organizations.AttachPolicy" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "AttachPolicyResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newAttachPolicyResponse :: AttachPolicyResponse Source #

Create a value of AttachPolicyResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.