resource_shares
Creates, updates, deletes or gets a resource_share resource or lists resource_shares in a region
Overview
| Name | resource_shares |
| Type | Resource |
| Description | Resource type definition for AWS::RAM::ResourceShare |
| Id | awscc.ram.resource_shares |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
allow_external_principals | boolean | Specifies 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`. |
arn | string | |
name | string | Specifies the name of the resource share. |
permission_arns | array | Specifies 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. |
principals | array | Specifies 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_arns | array | Specifies a list of one or more ARNs of the resources to associate with the resource share. |
sources | array | Specifies from which source accounts the service principal has access to the resources in this resource share. |
tags | array | Specifies 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. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::RAM::ResourceShare.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | resource_shares | INSERT | Name, region |
delete_resource | resource_shares | DELETE | Identifier, region |
update_resource | resource_shares | UPDATE | Identifier, PatchDocument, region |
list_resources | resource_shares_list_only | SELECT | region |
get_resource | resource_shares | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all resource_shares in a region.
SELECT
region,
arn
FROM awscc.ram.resource_shares_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new resource_share resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ram.resource_shares (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ram.resource_shares (
AllowExternalPrincipals,
Name,
PermissionArns,
Principals,
ResourceArns,
Sources,
Tags,
region
)
SELECT
'{{ allow_external_principals }}',
'{{ name }}',
'{{ permission_arns }}',
'{{ principals }}',
'{{ resource_arns }}',
'{{ sources }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: resource_share
props:
- name: allow_external_principals
value: '{{ allow_external_principals }}'
- name: name
value: '{{ name }}'
- name: permission_arns
value:
- '{{ permission_arns[0] }}'
- name: principals
value:
- '{{ principals[0] }}'
- name: resource_arns
value:
- '{{ resource_arns[0] }}'
- name: sources
value:
- '{{ sources[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
- Create
- Read
- Update
- Delete
- List
ram:CreateResourceShare,
ram:TagResource
ram:GetResourceShares
ram:GetPermission,
ram:GetResourceShares,
ram:GetResourceShareAssociations,
ram:ListResourceSharePermissions,
ram:UpdateResourceShare,
ram:AssociateResourceSharePermission,
ram:AssociateResourceShare,
ram:DisassociateResourceShare,
ram:UntagResource,
ram:TagResource
ram:DeleteResourceShare,
ram:GetResourceShares
ram:GetResourceShares