| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.IoT.CreatePolicy
Description
Creates an IoT policy.
The created policy is the default version for the policy. This operation creates a policy version with a version identifier of 1 and sets 1 as the policy's default version.
Requires permission to access the CreatePolicy action.
Synopsis
- data CreatePolicy = CreatePolicy' {
- tags :: Maybe [Tag]
- policyName :: Text
- policyDocument :: Text
- newCreatePolicy :: Text -> Text -> CreatePolicy
- createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag])
- createPolicy_policyName :: Lens' CreatePolicy Text
- createPolicy_policyDocument :: Lens' CreatePolicy Text
- data CreatePolicyResponse = CreatePolicyResponse' {}
- newCreatePolicyResponse :: Int -> CreatePolicyResponse
- createPolicyResponse_policyArn :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyDocument :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyName :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyVersionId :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int
Creating a Request
data CreatePolicy Source #
The input for the CreatePolicy operation.
See: newCreatePolicy smart constructor.
Constructors
| CreatePolicy' | |
Fields
| |
Instances
Arguments
| :: Text | |
| -> Text | |
| -> 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 - Metadata which can be used to manage the policy.
For URI Request parameters use format: ...key1=value1&key2=value2...
For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
CreatePolicy, createPolicy_policyName - The policy name.
CreatePolicy, createPolicy_policyDocument - The JSON document that describes the policy. policyDocument must
have a minimum length of 1, with a maximum length of 2048, excluding
whitespace.
Request Lenses
createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag]) Source #
Metadata which can be used to manage the policy.
For URI Request parameters use format: ...key1=value1&key2=value2...
For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
createPolicy_policyName :: Lens' CreatePolicy Text Source #
The policy name.
createPolicy_policyDocument :: Lens' CreatePolicy Text Source #
The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
Destructuring the Response
data CreatePolicyResponse Source #
The output from the CreatePolicy operation.
See: newCreatePolicyResponse smart constructor.
Constructors
| CreatePolicyResponse' | |
Fields
| |
Instances
newCreatePolicyResponse Source #
Arguments
| :: Int | |
| -> CreatePolicyResponse |
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:
CreatePolicyResponse, createPolicyResponse_policyArn - The policy ARN.
CreatePolicy, createPolicyResponse_policyDocument - The JSON document that describes the policy.
CreatePolicy, createPolicyResponse_policyName - The policy name.
CreatePolicyResponse, createPolicyResponse_policyVersionId - The policy version ID.
$sel:httpStatus:CreatePolicyResponse', createPolicyResponse_httpStatus - The response's http status code.
Response Lenses
createPolicyResponse_policyArn :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy ARN.
createPolicyResponse_policyDocument :: Lens' CreatePolicyResponse (Maybe Text) Source #
The JSON document that describes the policy.
createPolicyResponse_policyName :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy name.
createPolicyResponse_policyVersionId :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy version ID.
createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int Source #
The response's http status code.