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.CreatePolicy

Description

Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual AWS account.

For more information about policies and their use, see Managing Organization Policies.

If the request includes tags, then the requester must have the organizations:TagResource permission.

This operation can be called only from the organization's management account.

Synopsis

Creating a Request

data CreatePolicy Source #

See: newCreatePolicy smart constructor.

Constructors

CreatePolicy' 

Fields

  • tags :: Maybe [Tag]

    A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging AWS Organizations resources in the AWS Organizations User Guide.

    If any one of the tags is invalid or if you exceed the allowed number of tags for a policy, then the entire request fails and the policy is not created.

  • content :: Text

    The policy text content to add to the new policy. The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.

  • description :: Text

    An optional description to assign to the policy.

  • name :: Text

    The friendly name to assign to the policy.

    The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

  • type' :: PolicyType

    The type of policy to create. You can specify one of the following values:

Instances

Instances details
Eq CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Read CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Show CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Generic CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Associated Types

type Rep CreatePolicy :: Type -> Type #

NFData CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Methods

rnf :: CreatePolicy -> () #

Hashable CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

ToJSON CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

AWSRequest CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Associated Types

type AWSResponse CreatePolicy #

ToHeaders CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

ToPath CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

ToQuery CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

type Rep CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

type Rep CreatePolicy = D1 ('MetaData "CreatePolicy" "Amazonka.Organizations.CreatePolicy" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "CreatePolicy'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag])) :*: S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PolicyType)))))
type AWSResponse CreatePolicy Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

newCreatePolicy Source #

Create a value of CreatePolicy 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:tags:CreatePolicy', createPolicy_tags - A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging AWS Organizations resources in the AWS Organizations User Guide.

If any one of the tags is invalid or if you exceed the allowed number of tags for a policy, then the entire request fails and the policy is not created.

$sel:content:CreatePolicy', createPolicy_content - The policy text content to add to the new policy. The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.

$sel:description:CreatePolicy', createPolicy_description - An optional description to assign to the policy.

$sel:name:CreatePolicy', createPolicy_name - The friendly name to assign to the policy.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

$sel:type':CreatePolicy', createPolicy_type - The type of policy to create. You can specify one of the following values:

Request Lenses

createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag]) Source #

A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging AWS Organizations resources in the AWS Organizations User Guide.

If any one of the tags is invalid or if you exceed the allowed number of tags for a policy, then the entire request fails and the policy is not created.

createPolicy_content :: Lens' CreatePolicy Text Source #

The policy text content to add to the new policy. The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.

createPolicy_description :: Lens' CreatePolicy Text Source #

An optional description to assign to the policy.

createPolicy_name :: Lens' CreatePolicy Text Source #

The friendly name to assign to the policy.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

createPolicy_type :: Lens' CreatePolicy PolicyType Source #

The type of policy to create. You can specify one of the following values:

Destructuring the Response

data CreatePolicyResponse Source #

See: newCreatePolicyResponse smart constructor.

Constructors

CreatePolicyResponse' 

Fields

Instances

Instances details
Eq CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Read CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Show CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Generic CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Associated Types

type Rep CreatePolicyResponse :: Type -> Type #

NFData CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

Methods

rnf :: CreatePolicyResponse -> () #

type Rep CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.Organizations.CreatePolicy

type Rep CreatePolicyResponse = D1 ('MetaData "CreatePolicyResponse" "Amazonka.Organizations.CreatePolicy" "libZSservicesZSamazonka-organizationsZSamazonka-organizations" 'False) (C1 ('MetaCons "CreatePolicyResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Policy)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreatePolicyResponse Source #

Create a value of CreatePolicyResponse 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:policy:CreatePolicyResponse', createPolicyResponse_policy - A structure that contains details about the newly created policy.

$sel:httpStatus:CreatePolicyResponse', createPolicyResponse_httpStatus - The response's http status code.

Response Lenses

createPolicyResponse_policy :: Lens' CreatePolicyResponse (Maybe Policy) Source #

A structure that contains details about the newly created policy.