Amazon S3

Upload, download, list, and delete objects in Amazon S3 buckets.

Data and storageCredentials form7 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (7)
  4. upload-file
  5. decrypt-pgp-file
  6. deleteFile
  7. generate-signed-url
  8. list-files
  9. moveFile
  10. read-file
  11. Details

Connect

Auth type: Credentials form (custom_auth). Pass the fields the provider needs (listed below) as the connection's credentials. They are sealed at rest.

FieldTypeDescription
accessKeyIdrequiredtextAWS access key ID
secretAccessKeyrequiredsecretAWS secret access key
regionrequiredtextAWS region (e.g. us-east-1)
  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("amazon-s3", action, input) resolves with the provider's answer and rejects when Amazon S3 isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "amazon-s3"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Amazon S3 when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellAmazons3 = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Amazon S3 isn't connected.
  const output = await step.run("Amazon S3", () =>
    step.ctx.integrations.invoke("amazon-s3", "upload-file", {
      "file": "<file>"
    }),
  );
  step.ctx.log("Amazon S3 answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "amazon-s3",
    "piece_action": "upload-file",
    "input": {
      "file": "<file>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/amazon-s3/upload-file" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"file":"<file>"}}'

Actions

upload-file

Upload File. Upload an File to S3

Also accepted as upload_file.

InputTypeDescription
filerequiredfileFile
fileNameoptionaltextThe File Name to use, if not set the API will try to figure out the file name.
acloptionalone of "private" | "public-read" | "public-read-write" | "authenticated-read" | "aws-exec-read" | "bucket-owner-read" | "bucket-owner-full-control"ACL
typeoptionaltextContent Type of the uploaded file, if not set the API will try to figure out the content type.

decrypt-pgp-file

Decrypt PGP File. Decrypt a PGP encrypted file from S3 using a private key stored in AWS Secrets Manager

InputTypeDescription
keyrequiredtextThe key (path) of the encrypted file in S3
secretArnrequiredtextThe ARN of the secret in AWS Secrets Manager containing the PGP private key
passphraseArnoptionaltextOptional ARN of the secret in AWS Secrets Manager containing the passphrase for the private key (if the key is encrypted)
secretsManagerRegionoptionaltextThe AWS region where the Secrets Manager secret is stored (defaults to S3 region if not provided)
allowUnauthenticatedMessagesoptionalbooleanAllow decryption of messages without integrity protection (no MDC). WARNING: Without MDC, a malicious actor can silently modify the ciphertext, so the decrypted output may have been tampered with. On…
allowInsecureDecryptionWithSigningKeysoptionalbooleanAllow decryption using a key not marked for encryption (e.g. a signing-only key). Enable this if your PGP key was not flagged for encryption use.

deleteFile

Delete File. Deletes an existing file.

InputTypeDescription
keyrequiredtextThe key of the file to delete.

generate-signed-url

Generate signed URL. Generate a signed URL for a file in a s3 bucket

InputTypeDescription
keyrequiredtextThe path/filename of the file to get
expiresInrequirednumberHow long the URL should remain valid (in minutes).

list-files

List Files. List all files from an S3 bucket folder/prefix.

InputTypeDescription
prefixoptionaltextThe folder path to list files from (e.g., "folder/"). Leave empty to list from root.
maxKeysoptionalnumberMaximum number of files to return (1-1000)

moveFile

Move File. Move a File to Another Folder

InputTypeDescription
fileKeyrequiredtextThe key of the file to move
folderKeyrequiredtextThe key of the folder to move the file to

read-file

Read File. Read a file from S3 to use it in other steps

InputTypeDescription
keyrequiredtextThe key of the file to read

Details

Id
amazon-s3
Category
Data and storage
Tags
storage, cloud, aws, files, objects
Package
@activepieces/piece-amazon-s3@0.5.5
Runs
Through the integration runner