Archive Request to AWS S3
In this example shows how you can archive the body of incoming requests to AWS S3 Storage. This can be useful for auditing, logging, or archival scenarios. Additionally, you could use this policy to save the body of a request and then enqueue some async work that uses this body.
Configuration#
{
"name": "my-archive-request-aws-s3-inbound-policy",
"policyType": "archive-request-aws-s3-inbound",
"handler": {
"export": "ArchiveResponseOutbound",
"module": "$import(@zuplo/runtime)",
"options": {
"region": "us-east-1",
"bucketName": "test-bucket-123.s3.amazonaws.com",
"path": "responses/",
"accessKeyId": "$env(AWS_ACCESS_KEY_ID)",
"accessKeySecret": "$env(AWS_ACCESS_KEY_SECRET)"
}
}
}
Options#
name
the name of your policy instance. This is used as a reference in your routes.policyType
the identifier of the policy. This is used by the Zuplo UI. Value should bearchive-request-aws-s3-inbound
.handler/export
The name of the exported type. Value should bedefault
.handler/module
the module containing the policy. Value should be$import(./modules/YOUR_MODULE)
.handler/options
The options for this policy:region
The AWS region where the bucket is located
bucketName
The name of the storage bucket
path
The path where requests are stored
accessKeyId
The Access Key ID of the account authorized to write to the bucket
accessKeySecret
The Access Key Secret of the account authorized to write to the bucket