← All procedures

s3.upload

Upload content to S3 bucket

CLI
Package
@procedures/s3 · README
Path
["s3","upload"]
CLI
mark s3 upload --bucket <string> --key <string> --body <string>
As data
{"$proc":["s3","upload"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/s3"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["s3","upload"], { bucket: "<bucket>", key: "<key>", body: "<body>" });
console.log(JSON.stringify(result));

From the command line

$ mark s3 upload --bucket <string> --key <string> --body <string>

As data, in a program

{
  "$proc": ["s3", "upload"],
  "input": { "bucket": "<bucket>", "key": "<key>", "body": "<body>" }
}

Input

FieldTypeRequiredDefaultDescription
bucketstringyesS3 bucket name
keystringyesObject key (path in bucket)
bodystringyesContent to upload - string or base64 encoded binary
contentTypestringnoContent type (e.g., "application/json", "text/plain")
base64booleannoIf true, body is base64 encoded binary data
metadataobjectnoOptional metadata key-value pairs

Output

FieldTypeRequiredDefaultDescription
etagstringyesThe ETag of the object, without quotes
versionIdstringnoThe version id, when the bucket has versioning
locationstringyesThe S3 URI of the object (s3://bucket/key)
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "bucket": {
        "type": "string",
        "description": "S3 bucket name"
      },
      "key": {
        "type": "string",
        "description": "Object key (path in bucket)"
      },
      "body": {
        "type": "string",
        "description": "Content to upload - string or base64 encoded binary"
      },
      "contentType": {
        "description": "Content type (e.g., \"application/json\", \"text/plain\")",
        "type": "string"
      },
      "base64": {
        "description": "If true, body is base64 encoded binary data",
        "type": "boolean"
      },
      "metadata": {
        "description": "Optional metadata key-value pairs",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "required": [
      "bucket",
      "key",
      "body"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "etag": {
        "type": "string",
        "description": "The ETag of the object, without quotes"
      },
      "versionId": {
        "description": "The version id, when the bucket has versioning",
        "type": "string"
      },
      "location": {
        "type": "string",
        "description": "The S3 URI of the object (s3://bucket/key)"
      }
    },
    "required": [
      "etag",
      "location"
    ],
    "additionalProperties": {}
  }
}