AWS S3: Get Node
The AWS S3: Get Node allows a workflow to retrieve a file and its metadata from an S3 bucket.
Node Properties
There are three main configuration sections for the AWS S3: Get Node …
Credential Configuration
There are two options for configuring credentials:
-
Choose a Service Credential: Retrieves your AWS credentials from the selected service credential.
- Credential Name Template: Choose which of your application’s AWS service credentials you would like to use. Note: Service credentials are not accessible from Edge Workflows, so only direct configuration is available for them. This field is templatable.
-
Enter Connection Info: Configure the AWS credentials directly within the node. All fields are required.
- AWS Region Template: The AWS region to connect to. This field is templatable.
- AWS Access Key ID Template: The AWS access key ID associated with the AWS account you wish to use. This field is templatable.
- AWS Secret Access Key Template: The AWS secret access key associated with the AWS account you wish to use. This field is templatable.
We recommend that you create an AWS Key/Secret pair specifically for use in the Workflow Engine - a key that has access to the proper AWS S3 buckets. We also recommend that you store these values as service credentials.
AWS Permissions
In order to perform a get operation, the AWS user must have, at minimum, the following IAM Policy:
{
"Version": "YYYY-MM-DD",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::<bucket-name>/*"]
}
]
}
File Configuration
Next is to configure the fields required by S3. All applicable fields are templatable:
- Bucket Name: (Required) The S3 bucket where your file is located.
- File Name: (Required) The name of the file to retrieve, including the extension. If the file is in a subdirectory within the bucket, the path to the file should be included in this field. (e.g. “path/to/my/file.ext”)
Result
-
Result Type: Specifies how the file should be returned:
- Get File Contents: Place the file’s data on the payload. Files retrieved by this method have a maximum size of five megabytes.
- Get Download Link: Place a link to the file on the payload
- File Encoding: (Required) The encoding of the file that you’re retrieving. Defaults to UTF-8.
- Result Path: (Required) The result of the operation will be placed in an object at the specified payload path.
When the operation successfully executes, the result will contain two keys: the value
retrieved from AWS S3, and some metadata
about the file.
When the the operation encounters an error, the result will contain a single error
key.
Node Example
The AWS S3: Get Node’s output varies with the selected result type:
-
When
Get File Contents
is selected, the result will look like the following:{ "value": "1, 2, 3, 4 12, 340, 360, 417 45, 318, 342, 391 56, 362, 406, 419", "metadata": { ... } }
-
When
Get Download Link
is selected, the result will look like the following:{ "value": "https://<region>.amazonaws.com/<bucket-name>/<key>", "metadata": { ... } }
Note: Download links retrieved this way will expire after 7 days.
Node Errors
In the case of an error, the resulting object will contain an error
key instead of the normal value
and metadata
keys.
{
"error": "Access Denied"
}
Related Nodes
Was this page helpful?
Still looking for help? You can also search the WEGnology Forums or submit your question there.