Skip to main content

workload_shares

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

Overview

Nameworkload_shares
TypeResource
Idaws.wellarchitected.workload_shares

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
next_tokenstringThe token to use to retrieve the next set of results. (pattern: <code>[A-Za-z0-9+/=_-]+</code>)
workload_idstringThe ID assigned to the workload. This ID is unique within an Amazon Web Services Region. (pattern: <code>[0-9a-f]{32}</code>)
workload_share_summariesarrayA list of workload share summaries.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_workload_sharesselectworkload_id, regionSharedWithPrefix, NextToken, MaxResults, StatusList the workload shares associated with the workload.
create_workload_shareinsertworkload_id, region, SharedWith, PermissionType, ClientRequestTokenCreate a workload share. The owner of a workload can share it with other Amazon Web Services accounts and users in the same Amazon Web Services Region. Shared access to a workload is not removed until the workload invitation is deleted. If you share a workload with an organization or OU, all accounts in the organization or OU are granted access to the workload. For more information, see Sharing a workload in the Well-Architected Tool User Guide.
update_workload_shareupdateshare_id, workload_id, region, PermissionTypeUpdate a workload share.
delete_workload_sharedeleteshare_id, workload_id, ClientRequestToken, regionDelete a workload share.

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
ClientRequestTokenstring
regionstringAWS region (default: us-east-1)
share_idstring
workload_idstring
MaxResultsintegerThe maximum number of results to return for this request.
NextTokenstring
SharedWithPrefixstringThe Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload is shared.
Statusstring

SELECT examples

List the workload shares associated with the workload.

SELECT
next_token,
workload_id,
workload_share_summaries
FROM aws.wellarchitected.workload_shares
WHERE workload_id = '{{ workload_id }}' -- required
AND region = '{{ region }}' -- required
AND SharedWithPrefix = '{{ SharedWithPrefix }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND Status = '{{ Status }}'
;

INSERT examples

Create a workload share. The owner of a workload can share it with other Amazon Web Services accounts and users in the same Amazon Web Services Region. Shared access to a workload is not removed until the workload invitation is deleted. If you share a workload with an organization or OU, all accounts in the organization or OU are granted access to the workload. For more information, see Sharing a workload in the Well-Architected Tool User Guide.

INSERT INTO aws.wellarchitected.workload_shares (
SharedWith,
PermissionType,
ClientRequestToken,
workload_id,
region
)
SELECT
'{{ SharedWith }}' /* required */,
'{{ PermissionType }}' /* required */,
'{{ ClientRequestToken }}' /* required */,
'{{ workload_id }}',
'{{ region }}'
RETURNING
share_id,
workload_id
;

UPDATE examples

Update a workload share.

UPDATE aws.wellarchitected.workload_shares
SET
PermissionType = '{{ PermissionType }}'
WHERE
share_id = '{{ share_id }}' --required
AND workload_id = '{{ workload_id }}' --required
AND region = '{{ region }}' --required
AND PermissionType = '{{ PermissionType }}' --required
RETURNING
workload_id,
workload_share;

DELETE examples

Delete a workload share.

DELETE FROM aws.wellarchitected.workload_shares
WHERE share_id = '{{ share_id }}' --required
AND workload_id = '{{ workload_id }}' --required
AND ClientRequestToken = '{{ ClientRequestToken }}' --required
AND region = '{{ region }}' --required
;