workload_shares
Creates, updates, deletes, gets or lists a workload_shares resource.
Overview
| Name | workload_shares |
| Type | Resource |
| Id | aws.wellarchitected.workload_shares |
Fields
The following fields are returned by SELECT queries:
- list_workload_shares
| Name | Datatype | Description |
|---|---|---|
next_token | string | The token to use to retrieve the next set of results. (pattern: <code>[A-Za-z0-9+/=_-]+</code>) |
workload_id | string | The ID assigned to the workload. This ID is unique within an Amazon Web Services Region. (pattern: <code>[0-9a-f]{32}</code>) |
workload_share_summaries | array | A list of workload share summaries. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_workload_shares | select | workload_id, region | SharedWithPrefix, NextToken, MaxResults, Status | List the workload shares associated with the workload. |
create_workload_share | insert | workload_id, region, SharedWith, PermissionType, ClientRequestToken | 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. | |
update_workload_share | update | share_id, workload_id, region, PermissionType | Update a workload share. | |
delete_workload_share | delete | share_id, workload_id, ClientRequestToken, region | Delete 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.
| Name | Datatype | Description |
|---|---|---|
ClientRequestToken | string | |
region | string | AWS region (default: us-east-1) |
share_id | string | |
workload_id | string | |
MaxResults | integer | The maximum number of results to return for this request. |
NextToken | string | |
SharedWithPrefix | string | The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload is shared. |
Status | string |
SELECT examples
- list_workload_shares
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_workload_share
- Manifest
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
;
# Description fields are for documentation purposes
- name: workload_shares
props:
- name: workload_id
value: "{{ workload_id }}"
description: Required parameter for the workload_shares resource.
- name: region
value: "{{ region }}"
description: Required parameter for the workload_shares resource.
- name: SharedWith
value: "{{ SharedWith }}"
description: |
The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload, lens, profile, or review template is shared.
- name: PermissionType
value: "{{ PermissionType }}"
description: |
Permission granted on a share request.
valid_values: ['READONLY', 'CONTRIBUTOR']
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
description: |
A unique case-sensitive string used to ensure that this request is idempotent (executes only once). You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned. This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.
UPDATE examples
- update_workload_share
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_workload_share
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
;