attach_policy

IoT.Client.attach_policy(**kwargs)

Attaches the specified policy to the specified principal (certificate or other credential).

Requires permission to access the AttachPolicy action.

See also: AWS API Documentation

Request Syntax

response = client.attach_policy(
    policyName='string',
    target='string'
)
Parameters
  • policyName (string) --

    [REQUIRED]

    The name of the policy to attach.

  • target (string) --

    [REQUIRED]

    The identity to which the policy is attached. For example, a thing group or a certificate.

Returns

None

Exceptions

  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.UnauthorizedException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.InternalFailureException
  • IoT.Client.exceptions.LimitExceededException