Archive Response to AWS S3

In this example shows how you can archive the body of outgoing responses to AWS S3 Storage. This can be useful for auditing, logging, or archival scenarios.

Configuration#

{
  "name": "my-archive-response-aws-s3-outbound-policy",
  "policyType": "archive-response-aws-s3-outbound",
  "handler": {
    "export": "default",
    "module": "$import(./modules/YOUR_MODULE)",
    "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 be archive-response-aws-s3-outbound.
  • handler/export The name of the exported type. Value should be default.
  • 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

Was this article helpful?

Do you have any questions?Contact us
Check out ourproduct changelog