Skip to content

CreateGrant

Source: src/AWS/LicenseManager/CreateGrant.ts

Runtime binding for license-manager:CreateGrant — share a seller-issued license’s entitlements with an Amazon Web Services account, organization, or organizational unit. The distribution half of an ISV fulfillment backend: after minting a license with CreateLicense, grant it to the customer’s account.

Provide the implementation with Effect.provide(AWS.LicenseManager.CreateGrantHttp).

// init
const createGrant = yield* AWS.LicenseManager.CreateGrant();
// runtime
const { GrantArn } = yield* createGrant({
GrantName: "customer-grant",
LicenseArn: licenseArn,
HomeRegion: region,
Principals: [`arn:aws:iam::${customerAccountId}:root`],
AllowedOperations: ["CheckoutLicense", "CheckInLicense", "ExtendConsumptionLicense", "ListPurchasedLicenses"],
ClientToken: crypto.randomUUID(),
});