LicenseManager / Client / create_grant

create_grant

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 in the License Manager User Guide.

Set the type of grant with the GrantType field:

  • BuyerGrant - The default grant type, created by the seller when a customer subscribes to a product. The seller creates a license for the subscription and a buyer grant for the customer. With a buyer grant, the customer can use, consume, and distribute the license, according to the permissions the seller sets in the product contract.

  • DelegateGrant - A delegate grant gives the grantee read-only visibility into the licenses and grants that you have distributed to buyers for a product. The grantee can monitor that activity on your behalf, and can also listen for the related Amazon EventBridge events. A delegate grant conveys no entitlement to use the licenses, and its only allowed operation is ListReceivedLicenses. You must create the delegate grant, and its license, from the same Amazon Web Services account that you used to create those buyer licenses and grants.

See also: AWS API Documentation

Request Syntax

response = client.create_grant(
    ClientToken='string',
    GrantName='string',
    LicenseArn='string',
    Principals=[
        'string',
    ],
    HomeRegion='string',
    AllowedOperations=[
        'CreateGrant'|'CheckoutLicense'|'CheckoutBorrowLicense'|'CheckInLicense'|'ExtendConsumptionLicense'|'ListPurchasedLicenses'|'CreateToken'|'ListReceivedLicenses',
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    GrantType='BuyerGrant'|'DelegateGrant',
    Options={
        'ActivationOverrideBehavior': 'DISTRIBUTED_GRANTS_ONLY'|'ALL_GRANTS_PERMITTED_BY_ISSUER',
        'DesiredStatus': 'PENDING_WORKFLOW'|'PENDING_ACCEPT'|'REJECTED'|'ACTIVE'|'FAILED_WORKFLOW'|'DELETED'|'PENDING_DELETE'|'DISABLED'|'WORKFLOW_COMPLETED'
    }
)
Parameters:
  • ClientToken (string) –

    [REQUIRED]

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

  • GrantName (string) –

    [REQUIRED]

    Grant name.

  • LicenseArn (string) –

    [REQUIRED]

    Amazon Resource Name (ARN) of the license.

  • Principals (list) –

    [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) –

  • HomeRegion (string) –

    [REQUIRED]

    Home Region of the grant.

  • AllowedOperations (list) –

    [REQUIRED]

    Allowed operations for the grant.

    • (string) –

  • Tags (list) –

    Tags to add to the grant. For more information about tagging support in License Manager, see the TagResource operation.

    • (dict) –

      Details about the tags for a resource. For more information about tagging support in License Manager, see the TagResource operation.

      • Key (string) –

        The tag key.

      • Value (string) –

        The tag value.

  • GrantType (string) –

    The type of grant to create. For more information about each type, see the preceding description of this operation. Valid values:

    • BuyerGrant - The default grant type if you don’t specify a value. Conveys the entitlement to use the license.

    • DelegateGrant - Gives the grantee read-only visibility into the licenses and grants that you have distributed to buyers, with no entitlement to use them.

  • Options (dict) –

    The options for the grant: the status to set after creation, and how activating the grant affects other active grants for the same product.

    • ActivationOverrideBehavior (string) –

      An activation option for your grant that determines the behavior of activating a grant. Activation options can only be used with granted licenses sourced from the Amazon Web Services Marketplace. Additionally, the operation must activate the grant. For the CreateGrantVersion operation, specify ACTIVE for the Status parameter. For the CreateGrant operation, specify ACTIVE for the DesiredStatus option.

      • As a license administrator, you can optionally specify an ActivationOverrideBehavior when activating a grant.

      • As a grantor, you can optionally specify an ActivationOverrideBehavior when you activate a grant for a grantee account in your organization.

      • As a grantee, if the grantor creating the distributed grant doesn’t specify an ActivationOverrideBehavior, you can optionally specify one when you are activating the grant.

        DISTRIBUTED_GRANTS_ONLY

      Use this value to activate a grant without replacing any member account’s active grants for the same product.

      ALL_GRANTS_PERMITTED_BY_ISSUER

      Use this value to activate a grant and disable other active grants in any member accounts for the same product. This action will also replace their previously activated grants with this activated grant.

    • DesiredStatus (string) –

      The status of the grant after License Manager creates it. The only supported value is ACTIVE. Specify ACTIVE to create and activate the grant in one request.

      You can specify this option only for the CreateGrant operation, and only when the grant principal is an organization or an organizational unit (OU). To change the status of an existing grant, use the Status parameter of the CreateGrantVersion operation.

Return type:

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