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

Description

Creates a new version of the specified IoT policy. To update a policy, create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must use DeletePolicyVersion to delete an existing version before you create a new one.

Optionally, you can set the new version as the policy's default version. The default version is the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Requires permission to access the CreatePolicyVersion action.

Synopsis

Creating a Request

data CreatePolicyVersion Source #

The input for the CreatePolicyVersion operation.

See: newCreatePolicyVersion smart constructor.

Constructors

CreatePolicyVersion' 

Fields

  • setAsDefault :: Maybe Bool

    Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

  • policyName :: Text

    The policy name.

  • policyDocument :: Text

    The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.

Instances

Instances details
Eq CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Read CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Show CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Generic CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersion :: Type -> Type #

NFData CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Methods

rnf :: CreatePolicyVersion -> () #

Hashable CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

ToJSON CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

AWSRequest CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type AWSResponse CreatePolicyVersion #

ToHeaders CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

ToPath CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

ToQuery CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

type Rep CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

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

Defined in Amazonka.IoT.CreatePolicyVersion

newCreatePolicyVersion Source #

Create a value of CreatePolicyVersion 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:setAsDefault:CreatePolicyVersion', createPolicyVersion_setAsDefault - Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

$sel:policyName:CreatePolicyVersion', createPolicyVersion_policyName - The policy name.

$sel:policyDocument:CreatePolicyVersion', createPolicyVersion_policyDocument - The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.

Request Lenses

createPolicyVersion_setAsDefault :: Lens' CreatePolicyVersion (Maybe Bool) Source #

Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

createPolicyVersion_policyDocument :: Lens' CreatePolicyVersion Text Source #

The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.

Destructuring the Response

data CreatePolicyVersionResponse Source #

The output of the CreatePolicyVersion operation.

See: newCreatePolicyVersionResponse smart constructor.

Constructors

CreatePolicyVersionResponse' 

Fields

Instances

Instances details
Eq CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Read CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Show CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Generic CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersionResponse :: Type -> Type #

NFData CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

type Rep CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

type Rep CreatePolicyVersionResponse = D1 ('MetaData "CreatePolicyVersionResponse" "Amazonka.IoT.CreatePolicyVersion" "libZSservicesZSamazonka-iotZSamazonka-iot" 'False) (C1 ('MetaCons "CreatePolicyVersionResponse'" 'PrefixI 'True) ((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 "isDefaultVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newCreatePolicyVersionResponse Source #

Create a value of CreatePolicyVersionResponse 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:policyDocument:CreatePolicyVersion', createPolicyVersionResponse_policyDocument - The JSON document that describes the policy.

$sel:policyVersionId:CreatePolicyVersionResponse', createPolicyVersionResponse_policyVersionId - The policy version ID.

$sel:policyArn:CreatePolicyVersionResponse', createPolicyVersionResponse_policyArn - The policy ARN.

$sel:isDefaultVersion:CreatePolicyVersionResponse', createPolicyVersionResponse_isDefaultVersion - Specifies whether the policy version is the default.

$sel:httpStatus:CreatePolicyVersionResponse', createPolicyVersionResponse_httpStatus - The response's http status code.

Response Lenses

createPolicyVersionResponse_isDefaultVersion :: Lens' CreatePolicyVersionResponse (Maybe Bool) Source #

Specifies whether the policy version is the default.