Skip to main content

resource_shares

Creates, updates, deletes or gets a resource_share resource or lists resource_shares in a region

Overview

Nameresource_shares
TypeResource
DescriptionResource type definition for AWS::RAM::ResourceShare
Idawscc.ram.resource_shares

Fields

NameDatatypeDescription
allow_external_principalsbooleanSpecifies whether principals outside your organization in AWS Organizations can be associated with a resource share. A value of true lets you share with individual AWS accounts that are not in your organization. A value of false only has meaning if your account is a member of an AWS Organization. The default value is true.
arnstring
namestringSpecifies the name of the resource share.
permission_arnsarraySpecifies the Amazon Resource Names (ARNs) of the AWS RAM permission to associate with the resource share. If you do not specify an ARN for the permission, AWS RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
principalsarray
Specifies the principals to associate with the resource share. The possible values are:- An AWS account ID
- An Amazon Resource Name (ARN) of an organization in AWS Organizations
- An ARN of an organizational unit (OU) in AWS Organizations
- An ARN of an IAM role
- An ARN of an IAM user
resource_arnsarraySpecifies a list of one or more ARNs of the resources to associate with the resource share.
sourcesarraySpecifies from which source accounts the service principal has access to the resources in this resource share.
tagsarraySpecifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources associated with the resource share.
regionstringAWS region.

For more information, see AWS::RAM::ResourceShare.

Methods

NameResourceAccessible byRequired Params
create_resourceresource_sharesINSERTName, region
delete_resourceresource_sharesDELETEIdentifier, region
update_resourceresource_sharesUPDATEIdentifier, PatchDocument, region
list_resourcesresource_shares_list_onlySELECTregion
get_resourceresource_sharesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual resource_share.

SELECT
region,
allow_external_principals,
arn,
name,
permission_arns,
principals,
resource_arns,
sources,
tags
FROM awscc.ram.resource_shares
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new resource_share resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ram.resource_shares (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a resource_share resource, using stack-deploy.

/*+ update */
UPDATE awscc.ram.resource_shares
SET PatchDocument = string('{{ {
"AllowExternalPrincipals": allow_external_principals,
"Name": name,
"PermissionArns": permission_arns,
"Principals": principals,
"ResourceArns": resource_arns,
"Sources": sources,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ram.resource_shares
WHERE
Identifier = '{{ 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:

ParameterDescription
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 resource_shares resource, the following permissions are required:

ram:CreateResourceShare,
ram:TagResource