{
  "typeName" : "AWS::LicenseManager::License",
  "description" : "Resource Type definition for AWS::LicenseManager::License",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-licensemanager.git",
  "definitions" : {
    "ValidityDateFormat" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Begin" : {
          "description" : "Validity begin date for the license.",
          "type" : "string",
          "format" : "date-time"
        },
        "End" : {
          "description" : "Validity begin date for the license.",
          "type" : "string",
          "format" : "date-time"
        }
      },
      "required" : [ "Begin", "End" ]
    },
    "IssuerData" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "SignKey" : {
          "type" : "string"
        }
      },
      "required" : [ "Name" ],
      "additionalProperties" : false
    },
    "Entitlement" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        },
        "MaxCount" : {
          "type" : "integer"
        },
        "Overage" : {
          "type" : "boolean"
        },
        "Unit" : {
          "type" : "string"
        },
        "AllowCheckIn" : {
          "type" : "boolean"
        }
      },
      "required" : [ "Name", "Unit" ],
      "additionalProperties" : false
    },
    "ConsumptionConfiguration" : {
      "type" : "object",
      "properties" : {
        "RenewType" : {
          "type" : "string"
        },
        "ProvisionalConfiguration" : {
          "$ref" : "#/definitions/ProvisionalConfiguration"
        },
        "BorrowConfiguration" : {
          "$ref" : "#/definitions/BorrowConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "ProvisionalConfiguration" : {
      "type" : "object",
      "properties" : {
        "MaxTimeToLiveInMinutes" : {
          "type" : "integer"
        }
      },
      "required" : [ "MaxTimeToLiveInMinutes" ],
      "additionalProperties" : false
    },
    "BorrowConfiguration" : {
      "type" : "object",
      "properties" : {
        "MaxTimeToLiveInMinutes" : {
          "type" : "integer"
        },
        "AllowEarlyCheckIn" : {
          "type" : "boolean"
        }
      },
      "required" : [ "MaxTimeToLiveInMinutes", "AllowEarlyCheckIn" ],
      "additionalProperties" : false
    },
    "Metadata" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Name", "Value" ],
      "additionalProperties" : false
    },
    "LicenseStatus" : {
      "type" : "string"
    },
    "Arn" : {
      "type" : "string",
      "maxLength" : 2048
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag."
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag."
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "ProductSKU" : {
      "description" : "ProductSKU of the license.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024
    },
    "Issuer" : {
      "$ref" : "#/definitions/IssuerData"
    },
    "LicenseName" : {
      "description" : "Name for the created license.",
      "type" : "string"
    },
    "ProductName" : {
      "description" : "Product name for the created license.",
      "type" : "string"
    },
    "HomeRegion" : {
      "description" : "Home region for the created license.",
      "type" : "string"
    },
    "Validity" : {
      "$ref" : "#/definitions/ValidityDateFormat"
    },
    "Entitlements" : {
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/Entitlement"
      }
    },
    "Beneficiary" : {
      "description" : "Beneficiary of the license.",
      "type" : "string"
    },
    "ConsumptionConfiguration" : {
      "$ref" : "#/definitions/ConsumptionConfiguration"
    },
    "LicenseMetadata" : {
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/Metadata"
      }
    },
    "LicenseArn" : {
      "description" : "Amazon Resource Name is a unique name for each resource.",
      "$ref" : "#/definitions/Arn"
    },
    "Status" : {
      "$ref" : "#/definitions/LicenseStatus"
    },
    "Version" : {
      "description" : "The version of the license.",
      "type" : "string"
    },
    "Tags" : {
      "description" : "A list of tags to attach.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "LicenseName", "ProductName", "Issuer", "HomeRegion", "Validity", "ConsumptionConfiguration", "Entitlements", "Beneficiary", "ProductSKU" ],
  "readOnlyProperties" : [ "/properties/LicenseArn", "/properties/Version" ],
  "primaryIdentifier" : [ "/properties/LicenseArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "license-manager:CreateLicense", "license-manager:GetLicense", "license-manager:TagResource", "license-manager:ListTagsForResource", "kms:CreateGrant" ]
    },
    "read" : {
      "permissions" : [ "license-manager:GetLicense", "license-manager:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "license-manager:CreateLicenseVersion", "license-manager:GetLicense", "license-manager:TagResource", "license-manager:UntagResource", "license-manager:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "license-manager:DeleteLicense", "license-manager:GetLicense", "license-manager:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "license-manager:ListLicenses" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "license-manager:TagResource", "license-manager:UntagResource", "license-manager:ListTagsForResource" ]
  }
}