Navigation

put

On this page

Definition

put

Uploads binary data to S3 bucket.

Important

To perform an S3 service action, you must have rules set up for the action.

The put action cannot be in the first stage of a pipeline. The stage preceding the S3 put action stage must output a binary data; for example, a built-in action binary stage.

The put action stage has the following syntax:

Tip

In the stages, the action arguments can make use of variables (%%vars) defined for the stage as well as defined constants and expansions.

{ "service": <s3-servicename>, "action": "put", "args": { "contentType": <string>, "acl": <string>, "bucket": <string>, "key": <string> } }

The put action takes the following arguments:

Argument Type Description
bucket string The S3 bucket name.
key string The unique identifier for the uploaded object.
acl string

Access control list. Valid values are:

  • private
  • public-read
  • public-read-write
  • aws-exec-read
  • authenticated-read
  • bucket-owner-read
  • bucket-owner-full-control

See Amazon’s documentation for more information.

contentType string Data format, e.g. text/plain

Example

Consider the following pipeline of two stages:

[

  { "service": "", "action": "binary", "args": { "data": "68656c6c6f", "encoding": "hex" } },
  { "service": "my-s3-service",
     "action": "put",
     "args": {
        "contentType": "text/plain",
        "acl": "public-read",
        "bucket": "my-s3-bucket",
        "key": "myFile.txt"
     }
  }
]

Stage1: The built-in binary stage converts the hex-encoded data into binary and outputs the binary data to the put stage.

Stage2: The s3 put stage uploads the data to myFile.txt in the s3 bucket named my-s3-service.