licenses
Creates, updates, deletes or gets a license resource or lists licenses in a region
Overview
| Name | licenses |
| Type | Resource |
| Description | Resource Type definition for AWS::LicenseManager::License |
| Id | awscc.licensemanager.licenses |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
product_sku | string | ProductSKU of the license. |
issuer | object | |
license_name | string | Name for the created license. |
product_name | string | Product name for the created license. |
home_region | string | Home region for the created license. |
validity | object | |
entitlements | array | |
beneficiary | string | Beneficiary of the license. |
consumption_configuration | object | |
license_metadata | array | |
license_arn | string | Amazon Resource Name is a unique name for each resource. |
status | string | |
version | string | The version of the license. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
license_arn | string | Amazon Resource Name is a unique name for each resource. |
region | string | AWS region. |
For more information, see AWS::LicenseManager::License.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | licenses | INSERT | LicenseName, ProductName, Issuer, HomeRegion, Validity, ConsumptionConfiguration, Entitlements, region |
delete_resource | licenses | DELETE | Identifier, region |
update_resource | licenses | UPDATE | Identifier, PatchDocument, region |
list_resources | licenses_list_only | SELECT | region |
get_resource | licenses | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual license.
SELECT
region,
product_sku,
issuer,
license_name,
product_name,
home_region,
validity,
entitlements,
beneficiary,
consumption_configuration,
license_metadata,
license_arn,
status,
version
FROM awscc.licensemanager.licenses
WHERE
region = '{{ region }}' AND
Identifier = '{{ license_arn }}';
Lists all licenses in a region.
SELECT
region,
license_arn
FROM awscc.licensemanager.licenses_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new license resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.licensemanager.licenses (
Issuer,
LicenseName,
ProductName,
HomeRegion,
Validity,
Entitlements,
ConsumptionConfiguration,
region
)
SELECT
'{{ issuer }}',
'{{ license_name }}',
'{{ product_name }}',
'{{ home_region }}',
'{{ validity }}',
'{{ entitlements }}',
'{{ consumption_configuration }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.licensemanager.licenses (
ProductSKU,
Issuer,
LicenseName,
ProductName,
HomeRegion,
Validity,
Entitlements,
Beneficiary,
ConsumptionConfiguration,
LicenseMetadata,
Status,
region
)
SELECT
'{{ product_sku }}',
'{{ issuer }}',
'{{ license_name }}',
'{{ product_name }}',
'{{ home_region }}',
'{{ validity }}',
'{{ entitlements }}',
'{{ beneficiary }}',
'{{ consumption_configuration }}',
'{{ license_metadata }}',
'{{ status }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: license
props:
- name: product_sku
value: '{{ product_sku }}'
- name: issuer
value:
name: '{{ name }}'
sign_key: '{{ sign_key }}'
- name: license_name
value: '{{ license_name }}'
- name: product_name
value: '{{ product_name }}'
- name: home_region
value: '{{ home_region }}'
- name: validity
value:
begin: '{{ begin }}'
end: '{{ end }}'
- name: entitlements
value:
- name: '{{ name }}'
value: '{{ value }}'
max_count: '{{ max_count }}'
overage: '{{ overage }}'
unit: '{{ unit }}'
allow_check_in: '{{ allow_check_in }}'
- name: beneficiary
value: '{{ beneficiary }}'
- name: consumption_configuration
value:
renew_type: '{{ renew_type }}'
provisional_configuration:
max_time_to_live_in_minutes: '{{ max_time_to_live_in_minutes }}'
borrow_configuration:
max_time_to_live_in_minutes: '{{ max_time_to_live_in_minutes }}'
allow_early_check_in: '{{ allow_early_check_in }}'
- name: license_metadata
value:
- name: '{{ name }}'
value: '{{ value }}'
- name: status
value: '{{ status }}'
UPDATE example
Use the following StackQL query and manifest file to update a license resource, using stack-deploy.
/*+ update */
UPDATE awscc.licensemanager.licenses
SET PatchDocument = string('{{ {
"ProductSKU": product_sku,
"Issuer": issuer,
"LicenseName": license_name,
"ProductName": product_name,
"HomeRegion": home_region,
"Validity": validity,
"Entitlements": entitlements,
"Beneficiary": beneficiary,
"ConsumptionConfiguration": consumption_configuration,
"LicenseMetadata": license_metadata,
"Status": status
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ license_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.licensemanager.licenses
WHERE
Identifier = '{{ license_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the licenses resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
license-manager:CreateLicense
license-manager:GetLicense
license-manager:CreateLicenseVersion
license-manager:DeleteLicense
license-manager:ListLicenses