Skip to main content

location_s3s

Creates, updates, deletes or gets a location_s3 resource or lists location_s3s in a region

Overview

Namelocation_s3s
TypeResource
DescriptionResource schema for AWS::DataSync::LocationS3
Idawscc.datasync.location_s3s

Fields

NameDatatypeDescription
s3_configobjectThe Amazon Resource Name (ARN) of the AWS IAM role that is used to access an Amazon S3 bucket.
s3_bucket_arnstringThe Amazon Resource Name (ARN) of the Amazon S3 bucket.
subdirectorystringA 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_classstringThe Amazon S3 storage class you want to store your files in when this location is used as a task destination.
tagsarrayAn array of key-value pairs to apply to this resource.
location_arnstringThe Amazon Resource Name (ARN) of the Amazon S3 bucket location.
location_uristringThe URL of the S3 location that was described.
regionstringAWS region.

For more information, see AWS::DataSync::LocationS3.

Methods

NameResourceAccessible byRequired Params
create_resourcelocation_s3sINSERTS3Config, region
delete_resourcelocation_s3sDELETEIdentifier, region
update_resourcelocation_s3sUPDATEIdentifier, PatchDocument, region
list_resourceslocation_s3s_list_onlySELECTregion
get_resourcelocation_s3sSELECTIdentifier, region

SELECT examples

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 awscc.datasync.location_s3s
WHERE
region = '{{ region }}' AND
Identifier = '{{ location_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new location_s3 resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.datasync.location_s3s (
S3Config,
region
)
SELECT
'{{ s3_config }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a location_s3 resource, using stack-deploy.

/*+ update */
UPDATE awscc.datasync.location_s3s
SET PatchDocument = string('{{ {
"S3Config": s3_config,
"Subdirectory": subdirectory,
"S3StorageClass": s3_storage_class,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ location_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.datasync.location_s3s
WHERE
Identifier = '{{ location_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

datasync:CreateLocationS3,
datasync:DescribeLocationS3,
datasync:ListTagsForResource,
datasync:TagResource,
s3:ListAllMyBuckets,
s3:ListBucket,
iam:GetRole,
iam:PassRole