subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview
| Name | subscriptions |
| Type | Resource |
| Id | aws.datazone.subscriptions |
Fields
The following fields are returned by SELECT queries:
- get_subscription
- list_subscriptions
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the subscription. (pattern: <code>[a-zA-Z0-9_-]{1,36}</code>) |
created_at | string (date-time) | The timestamp of when the subscription was created. |
created_by | string | The Amazon DataZone user who created the subscription. |
domain_id | string | The ID of the Amazon DataZone domain in which the subscription exists. (pattern: <code>dzd[-][a-zA-Z0-9-]{1,36}</code>) |
retain_permissions | boolean | The retain permissions of the subscription. |
status | string | The status of the subscription. (APPROVED, REVOKED, CANCELLED) |
subscribed_listing | object | The details of the published asset for which the subscription grant is created. |
subscribed_principal | object | The principal that has the subscription grant for the asset. |
subscription_request_id | string | The ID of the subscription request. (pattern: <code>[a-zA-Z0-9_-]{1,36}</code>) |
updated_at | string (date-time) | The timestamp of when the subscription was updated. |
updated_by | string | The Amazon DataZone user who updated the subscription. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the subscription. (pattern: <code>[a-zA-Z0-9_-]{1,36}</code>) |
created_at | string (date-time) | The timestamp of when the subscription was created. |
created_by | string | The Amazon DataZone user who created the subscription. |
domain_id | string | The identifier of the Amazon DataZone domain in which a subscription exists. (pattern: <code>dzd[-][a-zA-Z0-9-]{1,36}</code>) |
retain_permissions | boolean | The retain permissions included in the subscription. |
status | string | The status of the subscription. (APPROVED, REVOKED, CANCELLED) |
subscribed_listing | object | The details of the published asset for which the subscription grant is created. |
subscribed_principal | object | The principal that has the subscription grant for the asset. |
subscription_request_id | string | The identifier of the subscription request for the subscription. (pattern: <code>[a-zA-Z0-9_-]{1,36}</code>) |
updated_at | string (date-time) | The timestamp of when the subscription was updated. |
updated_by | string | The Amazon DataZone user who updated the subscription. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subscription | select | domain_identifier, identifier, region | Gets a subscription in Amazon DataZone. | |
list_subscriptions | select | domain_identifier, region | subscriptionRequestIdentifier, status, subscribedListingId, owningProjectId, owningIamPrincipalArn, owningUserId, owningGroupId, approverProjectId, sortBy, sortOrder, maxResults, nextToken | Lists subscriptions in Amazon DataZone. |
revoke_subscription | update | domain_identifier, identifier, region | Revokes a specified subscription in Amazon DataZone. | |
accept_subscription_request | exec | domain_identifier, identifier, region | Accepts a subscription request to a specific asset. | |
reject_subscription_request | exec | domain_identifier, identifier, region | Rejects the specified subscription request. |
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.
| Name | Datatype | Description |
|---|---|---|
domain_identifier | string | The identifier of the Amazon DataZone domain in which the subscription request was rejected. |
identifier | string | The identifier of the subscription request that was rejected. |
region | string | AWS region (default: us-east-1) |
approverProjectId | string | The identifier of the project for the subscription's approver. |
maxResults | integer | The maximum number of subscriptions to return in a single call to ListSubscriptions. When the number of subscriptions to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListSubscriptions to list the next set of Subscriptions. |
nextToken | string | When the number of subscriptions is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of subscriptions, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListSubscriptions to list the next set of subscriptions. |
owningGroupId | string | The ID of the owning group. |
owningIamPrincipalArn | string | The ARN of the owning IAM principal. |
owningProjectId | string | The identifier of the owning project. |
owningUserId | string | The ID of the owning user. |
sortBy | string | Specifies the way in which the results of this action are to be sorted. |
sortOrder | string | Specifies the sort order for the results of this action. |
status | string | The status of the subscriptions that you want to list. This is not a required parameter, but if not provided, by default, Amazon DataZone returns only APPROVED subscriptions. |
subscribedListingId | string | The identifier of the subscribed listing for the subscriptions that you want to list. |
subscriptionRequestIdentifier | string | The identifier of the subscription request for the subscriptions that you want to list. |
SELECT examples
- get_subscription
- list_subscriptions
Gets a subscription in Amazon DataZone.
SELECT
id,
created_at,
created_by,
domain_id,
retain_permissions,
status,
subscribed_listing,
subscribed_principal,
subscription_request_id,
updated_at,
updated_by
FROM aws.datazone.subscriptions
WHERE domain_identifier = '{{ domain_identifier }}' -- required
AND identifier = '{{ identifier }}' -- required
AND region = '{{ region }}' -- required
;
Lists subscriptions in Amazon DataZone.
SELECT
id,
created_at,
created_by,
domain_id,
retain_permissions,
status,
subscribed_listing,
subscribed_principal,
subscription_request_id,
updated_at,
updated_by
FROM aws.datazone.subscriptions
WHERE domain_identifier = '{{ domain_identifier }}' -- required
AND region = '{{ region }}' -- required
AND subscriptionRequestIdentifier = '{{ subscriptionRequestIdentifier }}'
AND status = '{{ status }}'
AND subscribedListingId = '{{ subscribedListingId }}'
AND owningProjectId = '{{ owningProjectId }}'
AND owningIamPrincipalArn = '{{ owningIamPrincipalArn }}'
AND owningUserId = '{{ owningUserId }}'
AND owningGroupId = '{{ owningGroupId }}'
AND approverProjectId = '{{ approverProjectId }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
UPDATE examples
- revoke_subscription
Revokes a specified subscription in Amazon DataZone.
UPDATE aws.datazone.subscriptions
SET
retainPermissions = {{ retainPermissions }}
WHERE
domain_identifier = '{{ domain_identifier }}' --required
AND identifier = '{{ identifier }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
created_at,
created_by,
domain_id,
retain_permissions,
status,
subscribed_listing,
subscribed_principal,
subscription_request_id,
updated_at,
updated_by;
Lifecycle Methods
- accept_subscription_request
- reject_subscription_request
Accepts a subscription request to a specific asset.
EXEC aws.datazone.subscriptions.accept_subscription_request
@domain_identifier='{{ domain_identifier }}' --required,
@identifier='{{ identifier }}' --required,
@region='{{ region }}' --required
@@json=
'{
"decisionComment": "{{ decisionComment }}",
"assetScopes": "{{ assetScopes }}",
"assetPermissions": "{{ assetPermissions }}"
}'
;
Rejects the specified subscription request.
EXEC aws.datazone.subscriptions.reject_subscription_request
@domain_identifier='{{ domain_identifier }}' --required,
@identifier='{{ identifier }}' --required,
@region='{{ region }}' --required
@@json=
'{
"decisionComment": "{{ decisionComment }}"
}'
;