S3 - Get Object

Declaration

<AMAWSS3 BUCKETNAME="text" KEYNAME="text" FILE="text" RESULTDATASET="text" SESSION="text" />

See Also

Description

Retrieves a single object or multiple objects contained in an S3 bucket. You can store an object into a local file or store an object's contents into a variable. To specify more than one object, use wildcard characters (* or ?). To specify multiple objects or wildcard masks, separate them with a pipe symbol (|). Example: *.txt|*.bak

NOTE: To use this activity, you must have READ access to the object.

IMPORTANT: The S3 activities in AutoMate use the Amazon S3 engine to perform their work. Because of this, you must have a valid Amazon S3 service account to use these activities.

Practical Usage

Used to download one or more S3 objects.

Parameters

Object Properties

Property
Type
Required
Default
Markup
Description

Bucket Name

Text

Yes

(Empty)

BUCKETNAME="MyBucket"

Indicates the name of the bucket in which to get the object(s) from.

 

Key Name

Text

Yes

(Empty)

a) KEYNAME="filename.txt"
b) KEYNAME="*.txt"
c) KEYNAME=*.txt|*.doc"
d) KEYNAME="*.*"

Specifies the key name of the object (s) to get. A key is the unique identifier for an object within a bucket. To specify more than one object, use wildcard characters (* or ?). To specify multiple objects or wildcard masks, separate them with a pipe symbol (|). Example: *.txt|*.bak

Store object into local file

Text

No

(Empty)

a) FILE="c:\sourcefoldername\file.txt"
b) FILE="c:\sourcefoldername\*.txt"
c) FILE="c:\sourcefoldername\*.*"

Specifies the destination folder and (optionally) the file name(s) in which to store the retrieved S3 object(s). This can be a fully qualified path or a file name. Folders that do not exist will be automatically created at runtime.

Store object data into variable

Text

No

(Empty)

RESULTVARIABLE="myVar"

Indicates the name of the variable in which to populate with the contents of the retrieved object. (More on variables below under Notes).

NOTE: This property will only work with single object retrieval.

Create and populate dataset with S3 object information

Text

No

(Empty)

RESULTDATASET="PublicReadWrite"

Specifies the name of a dataset to be created and populated with information in regards to the retrieved object(s). This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. More on the dataset that this activity creates can be found below under Notes.

 

Credentials Properties

These properties allow you to enter a custom set of credentials specific to this activity or link this activity to an existing session.  

Property

Type

Required

Default

Markup

Description

Provide Credentials

 

 

 

 

Indicates where this activity's credentials should originate from. Different properties apply depending on the option selected.

The available options are:

  • Custom (Default) - Specifies that a custom set of credentials will be entered for this S3 activity. Select this option if performing a single S3 activity.

  • Session Based - Specifies that credentials should derive from a session created in a previous step with the use of the Create Session activity. This allows several S3 activities to be linked to a specific session.

Access Key

Text

Yes

(Empty)

ACCESSKEY="MyAccessKey"

Specifies the 20-character, alphanumeric string that uniquely identifies a user who owns an s3 account (i.e. 022QF06E7MXBSH9DHM02). This along with a Secret Access Key forms a secure information set that S3 uses to confirm a valid user's identity.

This property is active only if Custom is selected under the Provide Credentials property.

Secret Access Key

Text

Yes

(Empty)

SECRETKEY="SecretKey"

A 40-character string that serves the role as Password to access S3 (i.e. kWcrlUX5JEDGM/LtmEENI/aVmYvHNif5zB+d9+ct). This along with an associated Access Key forms a secure information set that S3 uses to confirm a valid user's identity.

This property is active only if Custom is selected under the Provide Credentials property.

Protocol

Text

No

HTTP

PROTOCOL = "HTTPS"

The protocol that should be used to make requests to the S3 service.

The available options are:

  • HTTP (Default)

  • HTTPS

This property is active only if Custom is selected under the Provide Credentials property.

User Agent

Text

No

AutoMate

USERAGENT="AutoMate"

The value of the HTTP User-Agent header. The User-Agent request-header field contains information about the user agent originating the request. The default User Agent is AutoMate.

This property is active only if Custom is selected under the Provide Credentials property.

Service URL

Text

No

(Empty)

SERVICEURL=

"https://eu-west-1.ec2.amazonaws.com"

The Service URL used to make requests to the S3 service. The Service URL provides the service endpoint.

This property is active only if Custom is selected under the Provide Credentials property.

Maximum retry on error

Number

No

(Empty)

MAXERRORRETRY="4"

Signifies how many times the Amazon S3 engine should retry the request before returning an error.

This property is active only if Custom is selected under the Provide Credentials property.

Proxy Host

Text

No

(Empty)

PROXYHOST="proxy.host.com"

The hostname (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server.

This property is active only if Custom is selected under the Provide Credentials property.

Proxy Port

Number

No

(Empty)

PROXYPORT="1028"

The port that should be used to connect to the proxy server.

This property is active only if Custom is selected under the Provide Credentials property.

Session Name

Text

Yes

(Empty)

SESSION="SessionName"

The session name that this activity should originate from. This allows several S3 activities to be linked to a specific session. Numerous sessions can be used within a single task.

This property is active only if Session Based is selected under the Provide Credentials property.

NOTE: Use the Create Session activity to create and name an S3 session.

 

Description Properties

The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab is part of AutoMate's Error Handling functionality which allows you to select / omit specific errors that will cause a particular step to fail.

More about error causes properties

On Error Properties

The On Error tab is part of AutoMate's Error Handling functionality which allows you to determine what the task should do if a particular step encounters an error.

More about on error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).

Name

Type

Return Value

theDataset.KeyName

 

Text

The Key Name of the retrieved object.

theDataset.AmazonID2

 

Text

A special token associated to the retrieved object that helps Amazon Web Service (AWS) troubleshoot problems.

theDataset.ETag

 

Text

The object's entity tag. This is a hash of the object that can be used to do conditional operations. The ETag only reflects changes to the contents of an object, not its metadata.

theDataset.Size

 

Number

The size of the object, in bytes.

theDataset.ContentType

 

Text

A standard MIME type describing the format of the object (i.e. text/plain).

theDataset.VersionID

Text

The version ID of the retrieved object if it has a unique version ID.

NOTE: To get the version ID, Versioning must be enabled using the Set Bucket Versioning activity.

 

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Get object "testFile.txt" from bucket "myBucket". Store it into file "C:\Temp\testFile.txt". Create and populate dataset "theDataset" with S3 object information. Use "mySession" S3 session.

<AMAWSS3 BUCKETNAME="myBucket" KEYNAME="testFile.txt" FILE="C:\Temp\testFile.txt" RESULTDATASET="theDataset" SESSION="mySession" />

↑ Top of Page