amazonka-iot-2.0: Amazon IoT SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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
ToJSON CreatePolicyVersion Source # 
Instance details

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

AWSRequest CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type AWSResponse CreatePolicyVersion #

Generic CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersion :: Type -> Type #

Read CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Show CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

NFData CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Methods

rnf :: CreatePolicyVersion -> () #

Eq CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Hashable CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

type AWSResponse 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" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" '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))))

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

CreatePolicyVersion, createPolicyVersion_policyName - The policy name.

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
Generic CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersionResponse :: Type -> Type #

Read CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Show CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

NFData CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IoT.CreatePolicyVersion

Eq 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" "amazonka-iot-2.0-6w03vgAfmrM1SG22OsNJXL" 'False) (C1 ('MetaCons "CreatePolicyVersionResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "isDefaultVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "policyArn") '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 "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:

CreatePolicyVersionResponse, createPolicyVersionResponse_isDefaultVersion - Specifies whether the policy version is the default.

CreatePolicyVersionResponse, createPolicyVersionResponse_policyArn - The policy ARN.

CreatePolicyVersion, createPolicyVersionResponse_policyDocument - The JSON document that describes the policy.

CreatePolicyVersionResponse, createPolicyVersionResponse_policyVersionId - The policy version ID.

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