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 new managed policy for your AWS account.
This operation creates a policy version with a version identifier of v1
and sets v1 as the policy's default version. For more information about policy versions, see Versioning for Managed Policies in the IAM User Guide .
For more information about managed policies in general, see Managed Policies and Inline Policies in the IAM User Guide .
Synopsis
- createPolicy :: Text -> Text -> CreatePolicy
- data CreatePolicy
- cpPath :: Lens' CreatePolicy (Maybe Text)
- cpDescription :: Lens' CreatePolicy (Maybe Text)
- cpPolicyName :: Lens' CreatePolicy Text
- cpPolicyDocument :: Lens' CreatePolicy Text
- 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:
cpPath
- The path for the policy. For more information about paths, see IAM Identifiers in the IAM User Guide . This parameter is optional. If it is not included, it defaults to a slash (). This parameter allows (per its <http:wikipedia.orgwikiregex regex pattern> ) a string of characters consisting of either a forward slash () by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (u0021) through the DEL character (u007F), including most punctuation characters, digits, and upper and lowercased letters.cpDescription
- A friendly description of the policy. Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables." The policy description is immutable. After a value is assigned, it cannot be changed.cpPolicyName
- The friendly name of the policy. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-cpPolicyDocument
- The JSON policy document that you want to use as the content for the new policy. The regex pattern used to validate this parameter is a string of characters consisting of the following: * Any printable ASCII character ranging from the space character (u0020) through the end of the ASCII character range * The printable characters in the Basic Latin and Latin-1 Supplement character set (through u00FF) * The special characters tab (u0009), line feed (u000A), and carriage return (u000D)
data CreatePolicy Source #
See: createPolicy
smart constructor.
Instances
Request Lenses
cpPath :: Lens' CreatePolicy (Maybe Text) Source #
The path for the policy. For more information about paths, see IAM Identifiers in the IAM User Guide . This parameter is optional. If it is not included, it defaults to a slash (). This parameter allows (per its <http:wikipedia.orgwikiregex regex pattern> ) a string of characters consisting of either a forward slash () by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (u0021) through the DEL character (u007F), including most punctuation characters, digits, and upper and lowercased letters.
cpDescription :: Lens' CreatePolicy (Maybe Text) Source #
A friendly description of the policy. Typically used to store information about the permissions defined in the policy. For example, "Grants access to production DynamoDB tables." The policy description is immutable. After a value is assigned, it cannot be changed.
cpPolicyName :: Lens' CreatePolicy Text Source #
The friendly name of the policy. This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
cpPolicyDocument :: Lens' CreatePolicy Text Source #
The JSON policy document that you want to use as the content for the new policy. The regex pattern used to validate this parameter is a string of characters consisting of the following: * Any printable ASCII character ranging from the space character (u0020) through the end of the ASCII character range * The printable characters in the Basic Latin and Latin-1 Supplement character set (through u00FF) * The special characters tab (u0009), line feed (u000A), and carriage return (u000D)
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 containing details about the new policy.cprsResponseStatus
- -- | The response status code.
data CreatePolicyResponse Source #
Contains the response to a successful CreatePolicy
request.
See: createPolicyResponse
smart constructor.
Instances
Response Lenses
cprsPolicy :: Lens' CreatePolicyResponse (Maybe Policy) Source #
A structure containing details about the new policy.
cprsResponseStatus :: Lens' CreatePolicyResponse Int Source #
- - | The response status code.