:doc:`VPCLattice <../../vpc-lattice>` / Client / put_auth_policy

***************
put_auth_policy
***************



.. py:method:: VPCLattice.Client.put_auth_policy(**kwargs)

  

  Creates or updates the auth policy. The policy string in JSON must not contain newlines or blank lines.

   

  For more information, see `Auth policies <https://docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html>`__ in the *Amazon VPC Lattice User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/PutAuthPolicy>`_  


  **Request Syntax**
  ::

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

    The ID or ARN of the service network or service for which the policy is created.

    

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

    The auth policy. The policy string in JSON must not contain newlines or blank lines.

    

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

    
    ::

      {
          'policy': 'string',
          'state': 'Active'|'Inactive'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **policy** *(string) --* 

        The auth policy. The policy string in JSON must not contain newlines or blank lines.

        
      

      - **state** *(string) --* 

        The state of the auth policy. The auth policy is only active when the auth type is set to ``AWS_IAM``. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is ``NONE``, then, any auth policy that you provide remains inactive. For more information, see `Create a service network <https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#create-service-network>`__ in the *Amazon VPC Lattice User Guide*.

        
  
  **Exceptions**
  
  *   :py:class:`VPCLattice.Client.exceptions.ValidationException`

  
  *   :py:class:`VPCLattice.Client.exceptions.AccessDeniedException`

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

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

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

  