create_policy_version
(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_policy_version(
policyName='string',
policyDocument='string',
setAsDefault=True|False
)
[REQUIRED]
The policy name.
[REQUIRED]
The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.
dict
Response Syntax
{
'policyArn': 'string',
'policyDocument': 'string',
'policyVersionId': 'string',
'isDefaultVersion': True|False
}
Response Structure
(dict) --
The output of the CreatePolicyVersion operation.
policyArn (string) --
The policy ARN.
policyDocument (string) --
The JSON document that describes the policy.
policyVersionId (string) --
The policy version ID.
isDefaultVersion (boolean) --
Specifies whether the policy version is the default.
Exceptions
IoT.Client.exceptions.ResourceNotFoundException
IoT.Client.exceptions.MalformedPolicyException
IoT.Client.exceptions.VersionsLimitExceededException
IoT.Client.exceptions.InvalidRequestException
IoT.Client.exceptions.ThrottlingException
IoT.Client.exceptions.UnauthorizedException
IoT.Client.exceptions.ServiceUnavailableException
IoT.Client.exceptions.InternalFailureException