libZSservicesZSamazonka-iotZSamazonka-iot
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.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

Creating a Request

data CreatePolicy Source #

The input for the CreatePolicy operation.

See: newCreatePolicy smart constructor.

Constructors

CreatePolicy' 

Fields

  • tags :: Maybe [Tag]

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

  • policyName :: Text

    The policy name.

  • policyDocument :: Text

    The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.

Instances

Instances details
Eq CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Read CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Show CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Generic CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Associated Types

type Rep CreatePolicy :: Type -> Type #

NFData CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Methods

rnf :: CreatePolicy -> () #

Hashable CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

ToJSON CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

AWSRequest CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Associated Types

type AWSResponse CreatePolicy #

ToHeaders CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

ToPath CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

ToQuery CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

type Rep CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

type Rep CreatePolicy = D1 ('MetaData "CreatePolicy" "Amazonka.IoT.CreatePolicy" "libZSservicesZSamazonka-iotZSamazonka-iot" 'False) (C1 ('MetaCons "CreatePolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag])) :*: (S1 ('MetaSel ('Just "policyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyDocument") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse CreatePolicy Source # 
Instance details

Defined in Amazonka.IoT.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 - 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..."

$sel:policyName:CreatePolicy', createPolicy_policyName - The policy name.

$sel:policyDocument: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_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

Instances details
Eq CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Read CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Show CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Generic CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Associated Types

type Rep CreatePolicyResponse :: Type -> Type #

NFData CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

Methods

rnf :: CreatePolicyResponse -> () #

type Rep CreatePolicyResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicy

type Rep CreatePolicyResponse = D1 ('MetaData "CreatePolicyResponse" "Amazonka.IoT.CreatePolicy" "libZSservicesZSamazonka-iotZSamazonka-iot" 'False) (C1 ('MetaCons "CreatePolicyResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "policyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "policyDocument") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "policyVersionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "policyArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: 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:policyName:CreatePolicy', createPolicyResponse_policyName - The policy name.

$sel:policyDocument:CreatePolicy', createPolicyResponse_policyDocument - The JSON document that describes the policy.

$sel:policyVersionId:CreatePolicyResponse', createPolicyResponse_policyVersionId - The policy version ID.

$sel:policyArn:CreatePolicyResponse', createPolicyResponse_policyArn - The policy ARN.

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

Response Lenses

createPolicyResponse_policyDocument :: Lens' CreatePolicyResponse (Maybe Text) Source #

The JSON document that describes the policy.