create_grant
async
¶
create_grant(
client_token: ClientToken,
grant_name: String,
license_arn: Arn,
principals: PrincipalArnList,
home_region: String,
allowed_operations: AllowedOperationList,
*,
config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
tags: Optional[TagList] = None,
grant_type: Optional[GrantType] = None,
options: Optional[Options] = None,
) -> CreateGrantResponse
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 isListReceivedLicenses. 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.
Parameters:
-
client_token(ClientToken) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
-
grant_name(String) –Grant name.
-
license_arn(Arn) –Amazon Resource Name (ARN) of the license.
-
principals(PrincipalArnList) –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.
-
-
home_region(String) –Home Region of the grant.
-
allowed_operations(AllowedOperationList) –Allowed operations for the grant.
-
tags(Optional[TagList], default:None) –Tags to add to the grant. For more information about tagging support in License Manager, see the TagResource operation.
-
grant_type(Optional[GrantType], default:None) –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(Optional[Options], default:None) –The options for the grant: the status to set after creation, and how activating the grant affects other active grants for the same product.
Raises:
-
AccessDeniedException–Access to resource denied.
-
AuthorizationException–The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy associated with this account.
-
InvalidParameterValueException–One or more parameter values are not valid.
-
RateLimitExceededException–Too many requests have been submitted. Try again after a brief wait.
-
ResourceLimitExceededException–Your resource limits have been exceeded.
-
ServerInternalException–The server experienced an internal error. Try again.
-
ValidationException–The provided input is not valid. Try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_license_manager/_services/async_license_manager.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 | |