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 |
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
- data CreatePolicy = CreatePolicy' {}
- newCreatePolicy :: Text -> Text -> Text -> PolicyType -> CreatePolicy
- createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag])
- createPolicy_content :: Lens' CreatePolicy Text
- createPolicy_description :: Lens' CreatePolicy Text
- createPolicy_name :: Lens' CreatePolicy Text
- createPolicy_type :: Lens' CreatePolicy PolicyType
- data CreatePolicyResponse = CreatePolicyResponse' {
- policy :: Maybe Policy
- httpStatus :: Int
- newCreatePolicyResponse :: Int -> CreatePolicyResponse
- createPolicyResponse_policy :: Lens' CreatePolicyResponse (Maybe Policy)
- createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int
Creating a Request
data CreatePolicy Source #
See: newCreatePolicy
smart constructor.
CreatePolicy' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> PolicyType | |
-> CreatePolicy |
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.
CreatePolicyResponse' | |
|
Instances
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.
createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int Source #
The response's http status code.