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)](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:<br />- An AWS account ID<br />- An Amazon Resource Name (ARN) of an organization in AWS Organizations<br />- An ARN of an organizational unit (OU) in AWS Organizations<br />- An ARN of an IAM role<br />- 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 = 'us-east-1' 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 }}';

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 }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ram.resource_shares
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

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

ram:CreateResourceShare,
ram:TagResource