Copyright | (c) 2013-2018 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 |
Language | Haskell2010 |
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 .
This operation can be called only from the organization's master account.
- createPolicy :: Text -> Text -> Text -> PolicyType -> CreatePolicy
- data CreatePolicy
- cpContent :: Lens' CreatePolicy Text
- cpDescription :: Lens' CreatePolicy Text
- cpName :: Lens' CreatePolicy Text
- cpType :: Lens' CreatePolicy PolicyType
- createPolicyResponse :: Int -> CreatePolicyResponse
- data CreatePolicyResponse
- cprsPolicy :: Lens' CreatePolicyResponse (Maybe Policy)
- cprsResponseStatus :: Lens' CreatePolicyResponse Int
Creating a Request
Creates a value of CreatePolicy
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
cpContent
- The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see Service Control Policy Syntax in the AWS Organizations User Guide .cpDescription
- An optional description to assign to the policy.cpName
- 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.cpType
- The type of policy to create.
data CreatePolicy Source #
See: createPolicy
smart constructor.
Request Lenses
cpContent :: Lens' CreatePolicy Text Source #
The policy content to add to the new policy. For example, if you create a service control policy (SCP), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. For more information about the SCP syntax, see Service Control Policy Syntax in the AWS Organizations User Guide .
cpDescription :: Lens' CreatePolicy Text Source #
An optional description to assign to the policy.
cpName :: 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.
cpType :: Lens' CreatePolicy PolicyType Source #
The type of policy to create.
Destructuring the Response
Creates a value of CreatePolicyResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
cprsPolicy
- A structure that contains details about the newly created policy.cprsResponseStatus
- -- | The response status code.
data CreatePolicyResponse Source #
See: createPolicyResponse
smart constructor.
Response Lenses
cprsPolicy :: Lens' CreatePolicyResponse (Maybe Policy) Source #
A structure that contains details about the newly created policy.
cprsResponseStatus :: Lens' CreatePolicyResponse Int Source #
- - | The response status code.