in managed-entitlements/src/managed_entitlements_sample.py [0:0]
def create_license(LicenseName, ProductSKU, ProductKeyEntitlements):
lm_client = get_client(default_region)
response = lm_client.create_license(
LicenseName = LicenseName,
ProductName = "My Product",
Beneficiary = "My Beneficiary",
ConsumptionConfiguration = {
"ProvisionalConfiguration": {
"MaxTimeToLiveInMinutes": 60
}
},
Entitlements = ProductKeyEntitlements,
HomeRegion = default_region,
Issuer = {
"Name": "My Company",
},
ProductSKU = ProductSKU,
Validity = {
"Begin": datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
},
LicenseMetadata = [{
"Name": "ProductName",
"Value": "My awesome product"
}],
ClientToken = str(uuid.uuid4())
)
print('AWS License Manager - Create License API response:')
pprint.pprint(response)
return response