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
Idaws.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)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 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.
principalsarraySpecifies 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

NameAccessible byRequired Params
create_resourceINSERTName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all resource_shares in a region.

SELECT
region,
allow_external_principals,
arn,
name,
permission_arns,
principals,
resource_arns,
sources,
tags
FROM aws.ram.resource_shares
WHERE region = 'us-east-1';

Gets all properties from an individual resource_share.

SELECT
region,
allow_external_principals,
arn,
name,
permission_arns,
principals,
resource_arns,
sources,
tags
FROM aws.ram.resource_shares
WHERE region = 'us-east-1' AND data__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 aws.ram.resource_shares (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ram.resource_shares
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

To operate on the resource_shares resource, the following permissions are required:

Create

ram:CreateResourceShare,
ram:TagResource

Read

ram:GetResourceShares

Update

ram:GetPermission,
ram:GetResourceShares,
ram:GetResourceShareAssociations,
ram:ListResourceSharePermissions,
ram:UpdateResourceShare,
ram:AssociateResourceSharePermission,
ram:AssociateResourceShare,
ram:DisassociateResourceShare,
ram:UntagResource,
ram:TagResource

Delete

ram:DeleteResourceShare,
ram:GetResourceShares

List

ram:GetResourceShares