Skip to main content

grants

Creates, updates, deletes, gets or lists a grants resource.

Overview

Namegrants
TypeResource
Idaws.license_manager.grants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
grant_arnstringAmazon Resource Name (ARN) of the grant. (pattern: <code>^arn:aws[a-zA-Z-]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$</code>)
grant_namestringGrant name.
grant_statusstringGrant status. (PENDING_WORKFLOW, PENDING_ACCEPT, REJECTED, ACTIVE, FAILED_WORKFLOW, DELETED, PENDING_DELETE, DISABLED, WORKFLOW_COMPLETED)
granted_operationsarrayGranted operations.
grantee_principal_arnstringThe grantee principal ARN. (pattern: <code>^arn:aws[a-zA-Z-]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$</code>)
home_regionstringHome Region of the grant.
license_arnstringLicense ARN. (pattern: <code>^arn:aws[a-zA-Z-]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$</code>)
optionsobjectThe options specified for the grant.
parent_arnstringParent ARN. (pattern: <code>^arn:aws[a-zA-Z-]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$</code>)
status_reasonstringGrant status reason. (pattern: <code>[\s\S]+</code>)
versionstringGrant version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_grantselectregionGets detailed information about the specified grant.
create_grantinsertregion, ClientToken, GrantName, LicenseArn, Principals, HomeRegion, AllowedOperationsCreates a grant for the specified license. A grant shares the use of license entitlements with a specific Amazon Web Services account, an organization, or an organizational unit (OU). For more information, see Granted licenses in License Manager in the License Manager User Guide.
create_grant_versioninsertregion, ClientToken, GrantArnCreates a new version of the specified grant. For more information, see Granted licenses in License Manager in the License Manager User Guide.
delete_grantdeleteregionDeletes the specified grant.
accept_grantexecregion, GrantArnAccepts the specified grant.
reject_grantexecregion, GrantArnRejects the specified grant.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Gets detailed information about the specified grant.

SELECT
grant_arn,
grant_name,
grant_status,
granted_operations,
grantee_principal_arn,
home_region,
license_arn,
options,
parent_arn,
status_reason,
version
FROM aws.license_manager.grants
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a grant for the specified license. A grant shares the use of license entitlements with a specific Amazon Web Services account, an organization, or an organizational unit (OU). For more information, see Granted licenses in License Manager in the License Manager User Guide.

INSERT INTO aws.license_manager.grants (
ClientToken,
GrantName,
LicenseArn,
Principals,
HomeRegion,
AllowedOperations,
Tags,
region
)
SELECT
'{{ ClientToken }}' /* required */,
'{{ GrantName }}' /* required */,
'{{ LicenseArn }}' /* required */,
'{{ Principals }}' /* required */,
'{{ HomeRegion }}' /* required */,
'{{ AllowedOperations }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
grant_arn,
status,
version
;

DELETE examples

Deletes the specified grant.

DELETE FROM aws.license_manager.grants
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Accepts the specified grant.

EXEC aws.license_manager.grants.accept_grant
@region='{{ region }}' --required
@@json=
'{
"GrantArn": "{{ GrantArn }}"
}'
;