:doc:`IoT <../../iot>` / Client / attach_security_profile

***********************
attach_security_profile
***********************



.. py:method:: IoT.Client.attach_security_profile(**kwargs)

  

  Associates a Device Defender security profile with a thing group or this account. Each thing group or account can have up to five security profiles associated with it.

   

  Requires permission to access the `AttachSecurityProfile <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachSecurityProfile>`_  


  **Request Syntax**
  ::

    response = client.attach_security_profile(
        securityProfileName='string',
        securityProfileTargetArn='string'
    )
    
  :type securityProfileName: string
  :param securityProfileName: **[REQUIRED]** 

    The security profile that is attached.

    

  
  :type securityProfileTargetArn: string
  :param securityProfileTargetArn: **[REQUIRED]** 

    The ARN of the target (thing group) to which the security profile is attached.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.LimitExceededException`

  
  *   :py:class:`IoT.Client.exceptions.VersionConflictException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  