Skip to content

S3 Writer

S3 Writer plugin is used to write data to Amazon AWS S3 storage, as well as S3 protocol compatible storage, such as MinIO.

In implementation, this plugin is written based on S3's official SDK 2.0.

Configuration Example

The following configuration is used to read data from memory and write to specified S3 bucket.

json
{
  "job": {
    "setting": {
      "speed": {
        "byte": -1,
        "channel": 1
      }
    },
    "content": {
      "reader": {
        "name": "streamreader",
        "parameter": {
          "column": [
            {
              "value": "Addax",
              "type": "string"
            },
            {
              "value": 19890604,
              "type": "long"
            },
            {
              "value": "1989-06-04 11:22:33",
              "type": "date"
            },
            {
              "value": true,
              "type": "bool"
            },
            {
              "value": "test",
              "type": "bytes"
            }
          ],
          "sliceRecordCount": 10
        }
      },
      "writer": {
        "name": "s3writer",
        "parameter": {
          "endpoint": "https://s3.amazonaws.com",
          "accessId": "xxxxxxxxxxxx",
          "accessKey": "xxxxxxxxxxxxxxxxxxxxxxx",
          "bucket": "test",
          "object": "upload.csv",
          "region": "ap-northeast-1",
          "encoding": "",
          "fieldDelimiter": ",",
          "writeMode": "truncate"
        }
      }
    }
  }
}

Parameters

ConfigurationRequiredData TypeDefault ValueDescription
endpointYesstringNoneS3 Server EndPoint address, e.g. s3.xx.amazonaws.com
regionYesstringNoneS3 Server Region address, e.g. ap-southeast-1
accessIdYesstringNoneAccess ID
accessKeyYesstringNoneAccess Key
bucketYesstringNoneBucket to write to
objectYesstringNoneObject to write to, see notes below
fieldDelimiterNochar','Field delimiter
nullFormatNochar\NWhat character to use when value is null
headerNolistNoneWrite file header information, e.g. ["id","title","url"]
maxFileSizeNoint100000Size of single object, in MB
encodingNostringutf-8File encoding format