Skip to content

Write S3 object

Uploads or replaces one bounded file at an exact S3-compatible object key.

@lainstack/s3/write-object · Object storage

Write S3 object uploads one file to an exact key in an S3-compatible bucket. It takes a run file, for example from @lainstack/s3/read-object or an upload field. It does not create content from text or data.

This block overwrites. If the key already exists, the new file replaces the object with no check. A test run does not make it side-effect free, so confirm with the user before test-running a draft that contains it. To remove an object, use @lainstack/s3/delete-object.

Traps:

  • The file must be at most 5 MiB, or the step fails. An upload field that holds more than one file, or none, fails. Limit the field to one file.
  • Check outcome. It is uploaded or outcome_unknown. With outcome_unknown the step still succeeds and the object may or may not exist. Do not treat the step as proof of upload.
  • The file’s content type is sent when the file has one.
  • The key is exact and relative to the connection’s configured prefix. It cannot start with http://, https://, s3:// or arn:.
  • size is the number of bytes sent.
Setting Key Type Details
S3-compatible connection (required) credentialId Connection Uses the selected S3-compatible object-storage connection. At most 255 characters.
Bucket bucket Text Optional exact bucket when the connection does not already select one. Keys are relative to the configured connection prefix.
Object key (required) key Text Exact object key, relative to the configured connection prefix.
Output Path Type
Object key key Text
Size size Number
Outcome outcome Text