:doc:`LicenseManager <../../license-manager>` / Client / create_grant

************
create_grant
************



.. py:method:: LicenseManager.Client.create_grant(**kwargs)

  

  Creates a grant for the specified license. A grant shares the use of license entitlements with a specific Amazon Web Services account, an organization, or an organizational unit (OU). For more information, see `Granted licenses in License Manager <https://docs.aws.amazon.com/license-manager/latest/userguide/granted-licenses.html>`__ in the *License Manager User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/CreateGrant>`_  


  **Request Syntax**
  ::

    response = client.create_grant(
        ClientToken='string',
        GrantName='string',
        LicenseArn='string',
        Principals=[
            'string',
        ],
        HomeRegion='string',
        AllowedOperations=[
            'CreateGrant'|'CheckoutLicense'|'CheckoutBorrowLicense'|'CheckInLicense'|'ExtendConsumptionLicense'|'ListPurchasedLicenses'|'CreateToken',
        ],
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ClientToken: string
  :param ClientToken: **[REQUIRED]** 

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    

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

    Grant name.

    

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

    Amazon Resource Name (ARN) of the license.

    

  
  :type Principals: list
  :param Principals: **[REQUIRED]** 

    The grant principals. You can specify one of the following as an Amazon Resource Name (ARN):

     

    
    * An Amazon Web Services account, which includes only the account specified.
    

     

    
    * An organizational unit (OU), which includes all accounts in the OU.
    

     

    
    * An organization, which will include all accounts across your organization.
    

    

  
    - *(string) --* 

    

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

    Home Region of the grant.

    

  
  :type AllowedOperations: list
  :param AllowedOperations: **[REQUIRED]** 

    Allowed operations for the grant.

    

  
    - *(string) --* 

    

  :type Tags: list
  :param Tags: 

    Tags to add to the grant. For more information about tagging support in License Manager, see the `TagResource <https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html>`__ operation.

    

  
    - *(dict) --* 

      Details about the tags for a resource. For more information about tagging support in License Manager, see the `TagResource <https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html>`__ operation.

      

    
      - **Key** *(string) --* 

        The tag key.

        

      
      - **Value** *(string) --* 

        The tag value.

        

      
    

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

    
    ::

      {
          'GrantArn': 'string',
          'Status': 'PENDING_WORKFLOW'|'PENDING_ACCEPT'|'REJECTED'|'ACTIVE'|'FAILED_WORKFLOW'|'DELETED'|'PENDING_DELETE'|'DISABLED'|'WORKFLOW_COMPLETED',
          'Version': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **GrantArn** *(string) --* 

        Grant ARN.

        
      

      - **Status** *(string) --* 

        Grant status.

        
      

      - **Version** *(string) --* 

        Grant version.

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

  
  *   :py:class:`LicenseManager.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`LicenseManager.Client.exceptions.ResourceLimitExceededException`

  
  *   :py:class:`LicenseManager.Client.exceptions.ServerInternalException`

  
  *   :py:class:`LicenseManager.Client.exceptions.AuthorizationException`

  
  *   :py:class:`LicenseManager.Client.exceptions.RateLimitExceededException`

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

  