:doc:`AIOps <../../aiops>` / Client / put_investigation_group_policy

******************************
put_investigation_group_policy
******************************



.. py:method:: AIOps.Client.put_investigation_group_policy(**kwargs)

  

  Creates an IAM resource policy and assigns it to the specified investigation group.

   

  If you create your investigation group with ``CreateInvestigationGroup`` and you want to enable CloudWatch alarms to create investigations and add events to investigations, you must use this operation to create a policy similar to this example.

   

  ``{ "Version": "2008-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "aiops.alarms.cloudwatch.amazonaws.com" }, "Action": [ "aiops:CreateInvestigation", "aiops:CreateInvestigationEvent" ], "Resource": "*", "Condition": { "StringEquals": { "aws:SourceAccount": "account-id" }, "ArnLike": { "aws:SourceArn": "arn:aws:cloudwatch:region:account-id:alarm:*" } } } ] }``

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/aiops-2018-05-10/PutInvestigationGroupPolicy>`_  


  **Request Syntax**
  ::

    response = client.put_investigation_group_policy(
        identifier='string',
        policy='string'
    )
    
  :type identifier: string
  :param identifier: **[REQUIRED]** 

    Specify either the name or the ARN of the investigation group that you want to assign the policy to.

    

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

    The policy, in JSON format.

    

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

    
    ::

      {
          'investigationGroupArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **investigationGroupArn** *(string) --* 

        The ARN of the investigation group that will use this policy.

        
  
  **Exceptions**
  
  *   :py:class:`AIOps.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`AIOps.Client.exceptions.ForbiddenException`

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

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

  
  *   :py:class:`AIOps.Client.exceptions.ValidationException`

  
  *   :py:class:`AIOps.Client.exceptions.InternalServerException`

  
  *   :py:class:`AIOps.Client.exceptions.ConflictException`

  