Skip to main content

Amazon S3 Component

Manage files within an Amazon (AWS) S3 bucket

Component key: aws-s3

Description#

Amazon S3 is a file storage solution from Amazon Web Services. The Amazon S3 component allows you to create, read, update, move, list or delete objects (files) within an Amazon S3 bucket.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Authorization Methods#

Amazon S3 requires one of the following authorization methods:

Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

An AWS IAM access key pair is required to interact with Amazon S3. The AWS access_key_id serves as the API Key, and the secret_access_key serves as the API Secret. Make sure that the key pair you generate in AWS has proper permissions to the S3 resources you want to access. Read more about S3 IAM actions in the AWS docs.

Actions#

Copy Object#

Copy an object in S3 from one location to another | key: copyObject

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your bucket(s) are stored.us-east-1

Destination Bucket Name

string
/ Required
destinationBucketAn Amazon S3 'bucket' is a container where files are stored. The destination bucket indicates the bucket where you want a file to be stored. If you are copying files within a single bucket, list the same bucket as the source and destination bucket.my-destination-bucket

Destination Key

string
/ Required
destinationKeyAn object in S3 is a file that is saved in a 'bucket'. This represents the destination object's key (file path). Do not include a leading /.path/to/destination/file.txt

Source Bucket Name

string
/ Required
sourceBucketAn Amazon S3 'bucket' is a container where files are stored. The source bucket indicates the bucket containing the file you want to copy. If you are copying files within a single bucket, list the same bucket as the source and destination bucket.my-source-bucket

Source Key

string
/ Required
sourceKeyAn object in S3 is a file that is saved in a 'bucket'. This represents the source object's key (file path). Do not include a leading /.path/to/source/file.txt

Output Example Payload#

{  "data": {    "CopyObjectResult": {      "ETag": "Example",      "LastModified": "2020-01-01T00:00:00.000Z"    }  }}

Delete Object#

Delete an Object within an S3 Bucket | key: deleteObject

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your bucket(s) are stored.us-east-1

Bucket Name

string
/ Required
bucketAn Amazon S3 'bucket' is a container where files are stored. You can create a bucket from within the AWS console. Bucket names contain only letters, numbers, and dashes.my-s3-bucket-abc123

Object Key

string
/ Required
objectKeyAn object in S3 is a file that is saved in a 'bucket'. This represents the object's key (file path). Do not include a leading /.path/to/file.txt

Get Object#

Get the contents of an object | key: getObject

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your bucket(s) are stored.us-east-1

Bucket Name

string
/ Required
bucketAn Amazon S3 'bucket' is a container where files are stored. You can create a bucket from within the AWS console. Bucket names contain only letters, numbers, and dashes.my-s3-bucket-abc123

Object Key

string
/ Required
objectKeyAn object in S3 is a file that is saved in a 'bucket'. This represents the object's key (file path). Do not include a leading /.path/to/file.txt

Output Example Payload#

{  "data": {    "data": [      69,      120,      97,      109,      112,      108,      101    ],    "type": "Buffer"  },  "contentType": "application/octet"}

List Objects#

List Objects in a Bucket | key: listObjects

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your bucket(s) are stored.us-east-1

Bucket Name

string
/ Required
bucketAn Amazon S3 'bucket' is a container where files are stored. You can create a bucket from within the AWS console. Bucket names contain only letters, numbers, and dashes.my-s3-bucket-abc123

Prefix

string
prefixList only objects prefixed with this string. For example, if you only want files in a directory called 'unprocessed', you can enter 'unprocessed/'. If this is left blank, all files in the selected bucket will be listed.path/to/files/

Output Example Payload#

{  "data": [    "Example Item 1",    "Example Item 2",    "Example Item 3"  ]}

Put Object#

Write an object to S3 | key: putObject

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your bucket(s) are stored.us-east-1

Bucket Name

string
/ Required
bucketAn Amazon S3 'bucket' is a container where files are stored. You can create a bucket from within the AWS console. Bucket names contain only letters, numbers, and dashes.my-s3-bucket-abc123

File Contents

data
/ Required
fileContentsThe contents to write to a file. This can be a string of text, it can be binary data (like an image or PDF) that was generated in a previous step.My File Contents

Object Key

string
/ Required
objectKeyAn object in S3 is a file that is saved in a 'bucket'. This represents the object's key (file path). Do not include a leading /.path/to/file.txt

Object Tags

string
taggingObjects in an S3 bucket can be optionally tagged so you can filter for files more easily. For example, you may want to tag customers with a key of 'Customer Name' and value of 'Mars Missions Corp'
note

File Contents can be a reference to a binary file from a previous step. For example, if you have an HTTP Get action that pulls down a .png image, you can reference its step name to write the .png to S3. Or, File Contents can be simple text, like 'Hello World'.

Output Example Payload#

{  "data": {    "ETag": "Example Tag",    "VersionId": "Example Version Id"  }}