Skip to main content

AWS S3

Add Query

You can add a query step by adding a workflow from the page list.
When you select the AWS S3 data source from the workflow step sidebar, the query input window appears.
See AWS S3 Data Source Guide for more information.

aws-s3

Actions

ListObjects

Retrieves a list of objects in a bucket. For more information, see the AWS S3 official document.

list-objects

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to retrieve the list of objects from.
Start After (startAfter)stringThe starting position of the object list to retrieve.
Prefix (prefix)stringThe prefix to retrieve the list of objects starting with a specific file name.
Max Keys (maxKeys)stringThe maximum number of objects to retrieve.

Query Result

When you run the signed URL generation action, the result is returned in the following structure.

interface Content {
ChecksumAlgorithm: string | null;
ETag: string;
Key: string;
LastModified: string;
Size: number;
StorageClass: string;
}

interface Result {
Contents: Content[];
ContinuationToken: string | null;
KeyCount: number;
MaxKeys: number;
Name: string;
StartAfter: string | null;
}

Using the Result

To use the result in another step, write as follows.

return outputs.stepName.Contents.map((content) => content.Key);

GetObject

Retrieves the contents of a specific object. For more information, see the AWS S3 official document.

get-object

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to retrieve the object from.
Key (key)stringThe key of the object to retrieve.

Query Result

interface Result {
Body: string;
}

Using the Result

To use the result in another step, write as follows.

return outputs.stepName.Body;

Generate URL

Generates an accessible URL for an object.

get-url

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to retrieve the object from.
Key (key)stringThe key of the object to retrieve.

Query Result

interface Result {
Url: string;
}

Using the Result

To use the result in another step, write as follows.

return outputs.stepName.Url;

PresignGetObject

Generates a signed URL for downloading an object. For more information, see the AWS S3 official document.

presign-get-object

Query Result

interface Result {
Url: string;
}

Using the Result

To use the result in another step, write as follows.

return outputs.stepName.Url;

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to retrieve the object from.
Key (key)stringThe key of the object to retrieve.
Expires In (expiresIn)numberThe expiration time in seconds.

PresignPutObject

Generates a signed URL for uploading an object. For more information, see the AWS S3 official document.

presign-put-object

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to retrieve the object from.
Key (key)stringThe key of the object to retrieve.
Expires In (expiresIn)numberThe expiration time in seconds.

Query Result

interface Result {
Url: string;
}

Using the Result

To use the result in another step, write as follows.

return outputs.stepName.Url;

PutObject

Uploads a new object to S3. For more information, see the AWS S3 official document.

put-object

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to upload the object to.
Key (key)stringThe key of the object to upload.
Body (body)stringThe content of the object to upload.
Acl (acl)stringThe access control list of the object.
Content MD5 (contentMd5)stringThe MD5 hash of the object content.

Query Result

type Result = Record<string, never>;

putObject returns an empty object.

DeleteObject

Deletes an object from S3. For more information, see the AWS S3 official document.

delete-object

Parameters

NameTypeDescription
Bucket (bucket)stringThe name of the bucket to delete the object from.
Key (key)stringThe key of the object to delete.
Version ID (versionId)stringThe version ID of the object to delete.

Query Result

type Result = Record<string, never>;

deleteObject returns an empty object.