Menu
AWS IoT
Developer Guide

DeletePolicyVersion

Deletes the specified version of the specified policy. You cannot delete the default version of a policy using this API. To delete the default version of a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

Request syntax:

DELETE /policies/policyName/version/policyVersionId

URI Request Parameters:

Name

Type

Req?

Description

policyName

PolicyName

yes

The name of the policy.

policyVersionId

PolicyVersionId

yes

The policy version ID.

Errors:

DeleteConflictException

You can't delete the resource because it is attached to one or more resources.

HTTP response code: 409

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

CLI

Synopsis:

aws iot delete-policy-version \ --policy-name <value> \ --policy-version-id <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "policyName": "string", "policyVersionId": "string" }

cli-input-json fields:

Name

Type

Description

policyName

string

length max:128 min:1

pattern: [w+=,.@-]+

The name of the policy.

policyVersionId

string

pattern: [0-9]+

The policy version ID.

Output:

None

On this page: