Menu
AWS IoT
Developer Guide

DetachPolicy

Detaches a policy from the specified target.

Request syntax:

POST /target-policies/policyName Content-type: application/json { "target": "string" }

URI Request Parameters:

Name

Type

Req?

Description

policyName

PolicyName

yes

The policy to detach.

Request Body Parameters:

Name

Type

Req?

Description

target

PolicyTarget

yes

The target from which the policy will be detached.

Errors:

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

LimitExceededException

The number of attached entities exceeds the limit.

HTTP response code: 410

CLI

Synopsis:

aws iot detach-policy \ --policy-name <value> \ --target <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "policyName": "string", "target": "string" }

cli-input-json fields:

Name

Type

Description

policyName

string

length max:128 min:1

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

The policy to detach.

target

string

The target from which the policy will be detached.

Output:

None

On this page: