IoT / Client / attach_thing_principal
attach_thing_principal#
- IoT.Client.attach_thing_principal(**kwargs)#
Attaches the specified principal to the specified thing. A principal can be X.509 certificates, Amazon Cognito identities or federated identities.
Requires permission to access the AttachThingPrincipal action.
See also: AWS API Documentation
Request Syntax
response = client.attach_thing_principal( thingName='string', principal='string', thingPrincipalType='EXCLUSIVE_THING'|'NON_EXCLUSIVE_THING' )
- Parameters:
thingName (string) –
[REQUIRED]
The name of the thing.
principal (string) –
[REQUIRED]
The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.
thingPrincipalType (string) –
The type of the relation you want to specify when you attach a principal to a thing.
EXCLUSIVE_THING
- Attaches the specified principal to the specified thing, exclusively. The thing will be the only thing that’s attached to the principal.NON_EXCLUSIVE_THING
- Attaches the specified principal to the specified thing. Multiple things can be attached to the principal.
- Return type:
dict
- Returns:
Response Syntax
{}
Response Structure
(dict) –
The output from the AttachThingPrincipal operation.
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