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 | aws.ram.resource_shares |
Fields
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: - 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_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. |
For more information, see AWS::RAM::ResourceShare
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ram.resource_shares (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ram.resource_shares (
AllowExternalPrincipals,
Name,
PermissionArns,
Principals,
ResourceArns,
Sources,
Tags,
region
)
SELECT
'{{ AllowExternalPrincipals }}',
'{{ Name }}',
'{{ PermissionArns }}',
'{{ Principals }}',
'{{ ResourceArns }}',
'{{ 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: AllowExternalPrincipals
value: '{{ AllowExternalPrincipals }}'
- name: Name
value: '{{ Name }}'
- name: PermissionArns
value:
- '{{ PermissionArns[0] }}'
- name: Principals
value:
- '{{ Principals[0] }}'
- name: ResourceArns
value:
- '{{ ResourceArns[0] }}'
- name: Sources
value:
- '{{ Sources[0] }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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