Sample ETL Chainset to Render rml Template to AWS S3 Bucket

This ETL sample (947 Bytes) illustrates how to create a chainset to render an rml template and write the rendered file output to a dynamic sub-directory in AWS S3 bucket.

Ensure that an S3 bucket has been configured and enabled in the System Settings module before using this example, e.g.

1/Configure the S3 path at the root level in the System Settings Module, e.g.

2/Upload the attached ETL chainset sample, open the chain properties and click on ‘Explain’ for the step details:

3/The JSON Record is where the parameters, rml template and mime-type is declared. These default values can be overwritten at the API call if ‘Upstream overrides this’ is selected.

4/For this example chainset the following sample is used:

{
“date_today” : “$date_today”,
“rml” : “/ElixirSamples/Report/RML/Pivot Table.rml”,
“Staff Name” : “X”,
“company_name” : “companyY”,
“mimeType” : “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”
}

  • ‘date_today’ takes the date value from the previous date step for the dynamic subdirectory
  • ‘rml’ is the repository path of the rml template, ‘Staff Name’ is the rml parameter
  • ‘company_name’ is the parameter for the dynamic subdirectory
  • ‘mimeType’ is the rendered file output

5/Construct the dynamic subdirectory path using the ‘String Add Prefix’ step, e.g.

6/The ‘String Substitute’ step looks up the selected field and replaces ${parameters} with values from the other fields



7/Select the bucket name, path and mime-type fields to look up

8/If tested successfully the ETL Designer logs will return the following result

9/The HTTP endpoint step allows you to call the ETL chainset via REST API, you will need to create an API Token for this in the API Tokens module e.g.

curl -v "https://[your Ambience/Repertoire Server address]:[port]/etl/endpoint/testOutput/01_RenderToS3?Staff%20Name=Jasmine%20Chen&company_name=ACME%20Industries&elx.token=[API token]"

The API call returns the following parameter info e.g.:
“rml”: “/ElixirSamples/Report/RML/Pivot Table.rml”,
“company_name”: “ACME Industries”,
“mimeType”: “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”,
“Staff Name”: “Jasmine Chen”,
“date_today”: “2025-05-19”,

And the results of the API call if successful, e.g.:
“filename”: “/ACME Industries/2025-05-19/Pivot Table.xlsx”,
“s3-put-info”: {
“region”: “”,
“bucket”: “”,
“path”: “ambience-demo/ACME Industries/2025-05-19/Pivot Table.xlsx”,
“length”: 5745
},