location_s3s
Creates, updates, deletes or gets a location_s3
resource or lists location_s3s
in a region
Overview
Name | location_s3s |
Type | Resource |
Description | Resource schema for AWS::DataSync::LocationS3 |
Id | aws.datasync.location_s3s |
Fields
Name | Datatype | Description |
---|---|---|
s3_config | object | The Amazon Resource Name (ARN) of the AWS IAM role that is used to access an Amazon S3 bucket. |
s3_bucket_arn | string | The Amazon Resource Name (ARN) of the Amazon S3 bucket. |
subdirectory | string | A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination. |
s3_storage_class | string | The Amazon S3 storage class you want to store your files in when this location is used as a task destination. |
tags | array | An array of key-value pairs to apply to this resource. |
location_arn | string | The Amazon Resource Name (ARN) of the Amazon S3 bucket location. |
location_uri | string | The URL of the S3 location that was described. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | S3Config, 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 location_s3s
in a region.
SELECT
region,
s3_config,
s3_bucket_arn,
subdirectory,
s3_storage_class,
tags,
location_arn,
location_uri
FROM aws.datasync.location_s3s
WHERE region = 'us-east-1';
Gets all properties from an individual location_s3
.
SELECT
region,
s3_config,
s3_bucket_arn,
subdirectory,
s3_storage_class,
tags,
location_arn,
location_uri
FROM aws.datasync.location_s3s
WHERE region = 'us-east-1' AND data__Identifier = '<LocationArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new location_s3
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.datasync.location_s3s (
S3Config,
region
)
SELECT
'{{ S3Config }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.datasync.location_s3s (
S3Config,
S3BucketArn,
Subdirectory,
S3StorageClass,
Tags,
region
)
SELECT
'{{ S3Config }}',
'{{ S3BucketArn }}',
'{{ Subdirectory }}',
'{{ S3StorageClass }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: location_s3
props:
- name: S3Config
value:
BucketAccessRoleArn: '{{ BucketAccessRoleArn }}'
- name: S3BucketArn
value: '{{ S3BucketArn }}'
- name: Subdirectory
value: '{{ Subdirectory }}'
- name: S3StorageClass
value: '{{ S3StorageClass }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.datasync.location_s3s
WHERE data__Identifier = '<LocationArn>'
AND region = 'us-east-1';
Permissions
To operate on the location_s3s
resource, the following permissions are required:
Create
datasync:CreateLocationS3,
datasync:DescribeLocationS3,
datasync:ListTagsForResource,
datasync:TagResource,
s3:ListAllMyBuckets,
s3:ListBucket,
iam:GetRole,
iam:PassRole
Read
datasync:DescribeLocationS3,
datasync:ListTagsForResource
Update
datasync:DescribeLocationS3,
datasync:ListTagsForResource,
datasync:TagResource,
datasync:UntagResource
Delete
datasync:DeleteLocation
List
datasync:ListLocations