#!/bin/bash # Replace with intended product ID on AWS Marketplace PRODUCT_ID=${PRODUCT_ID} echo "PRODDUCT ID "+${PRODUCT_ID} # Replace with license recipient's AWS Account ID BENEFICIARY_ACCOUNT_ID=${BENEFICIARY_ACCOUNT_ID} echo "Beneficiary ID "+${BENEFICIARY_ACCOUNT_ID} # Replace with your product's name PRODUCT_NAME="Test Product" # Replace with your seller name on AWS Marketplace SELLER_OF_RECORD="Test Seller" # Replace with intended license name LICENSE_NAME="AWSMP Test License" # Replace the following with desired contract dimensions # More info here: https://docs.aws.amazon.com/license-manager/latest/APIReference/API_Entitlement.html # Example "configurable entitlement" ENTITLEMENTS='[ { "Name": "ReadOnly", "MaxCount": 5, "Overage": false, "Unit": "Count", "AllowCheckIn": true } ]' # Example "tiered entitlement" # ENTITLEMENTS='[ # { # "Name": "EnterpriseUsage", # "Value": "Enabled", # "Unit": "None" # } # ]' # Format "yyyy-mm-ddTHH:mm:ss.SSSZ" # This creates a validity period of 10 days starting the current day # Can be updated to desired dates VALIDITY_START=$(date +%Y-%m-%dT%H:%M:%S.%SZ) VALIDITY_END=$(date -j -v+10d +"%Y-%m-%dT%H:%M:%S.%SZ") # Configuration for consumption of the license as set on Marketplace products CONSUMPTION_CONFIG='{ "RenewType": "None", "ProvisionalConfiguration": { "MaxTimeToLiveInMinutes": 60 } }' # License's home Region HOME_REGION=us-east-1 # License issuer's name ISSUER=Self # Run AWS CLI command to create a license aws license-manager create-license \ --license-name "${LICENSE_NAME}" \ --product-name "${PRODUCT_NAME}" \ --product-sku "${PRODUCT_ID}" \ --issuer Name="${ISSUER}" \ --beneficiary "${BENEFICIARY_ACCOUNT_ID}" \ --validity 'Begin="'"${VALIDITY_START}"'",End="'"${VALIDITY_END}"'"' \ --entitlements "${ENTITLEMENTS}" \ --home-region "${HOME_REGION}" \ --region "${HOME_REGION}" \ --consumption-configuration "${CONSUMPTION_CONFIG}" \ --client-token $(uuidgen)