Navigation: Amazon AWS >

Request Message

 

 

 

AWS Lambda Request Message

The AWS Lambda request message format for FileMasker consists of some mandatory fields and some optional fields.

 

Mandatory Fields
  

The following fields must be present in an AWS request message to a FileMasker Lambda.
  

inPath: the S3 path to the original file to be masked.
  

outFolderPath: the S3 folder where the masked version of the original file shall be written. If the folder does not exist then it shall be created automatically. If the file already exists in the out folder then it shall be replaced. The file name shall be the same name as the original file.
  

projectPath: the S3 path to the FileMasker project file (.fmp) that defines the masking to be performed.
   

licensePath: the S3 path to your FileMasker license file (.fml). Your license file can be downloaded from your user account at www.dataveil.com. You will then need to upload your license file into an S3 bucket.
  

region: this should match the S3 files locations and where your KMS keys are configured.

 

Example:

{
      "inPath": "bucket/file.json",
      "outFolderPath": "bucket/outfolder/",
      "projectPath": "bucket/myproject.fmp",
      "licensePath": "bucket/license.fml",
      "region": "ap-southeast-2"
 }
  

Optional Fields
  

The following fields are optional. If they are present then they override the default setting of FileMasker operation (e.g. the 'banner' setting) or settings within the current project (e.g. a CSV parameter).
  

adjustOutFileExt can be true (default) or false

Determines whether the output file name extension should be adjusted if the file is produced with a compression different to the input file. For example, if this parameter is 'true' and the input file is uncompressed, and the output file is created using GZIP compression then ".gz" shall be appended to the output file name if it doesn't already have the ".gz" extension. Conversely, if the input file is GZIP compressed and the output file created is uncompressed then ".gz" shall be stripped from the output file name. Please also refer to the parameters inCompression and outCompression.
  

banner

LINE Displays a startup banner on only a single line that contains input path, output path and FileMasker version number (default).

BRIEF Displays a startup banner containing similar information to LINE but each parameter is logged to a separate line.

DETAIL Displays a startup banner where all relevant parameters are logged each to a separate line. Non-relevant parameters shall not be logged. For example, if CSV parameters are specified in the request message but the effective format is JSON then the CSV parameters are ignored and shall not be logged.
  

csvParams

If the effective format is CSV then the following fields can override the project's CSV settings. You do not need to specify all of these parameters, only those that you wish to override.

headerPresent can be true or false. If true then the first row is expected to be a row containing the field names.

quoteChar Specifies the CSV quote character. You can specify the actual character or use the FileMasker command line method of specifying unprintable characters.

writeQuotes 

AS_NEEDED (default)

ALWAYS

NEVER

columnSeparator Specifies the CSV separator character. You can specify the actual character or use the FileMasker command line method of specifying unprintable characters.
  

format

This parameter can be used to override the project's format setting. This could be useful if you have both CSV files and JSON files where the JSON field names at root level match those of field names in CSV heading row.

CSV The input file is expected to be a CSV format file. Only CSV FileMasker parameters shall be relevant.

JSON The input file is expected to be a JSON format file. Only JSON FileMasker parameters shall be relevant.
  

inCompression

The default value is taken from the project file's Compression setting in the Input file section. This parameter can be overridden using the values below.

NONE Input file is not compressed.

FILE_EXTENSION Input file compression shall be determined by its file extension. Currently this means that if the file ends with ".gz" then GZIP shall be assumed, otherwise NONE shall be assumed.

GZIP Input file is gzip compressed.
  

jsonParams

If the effective format is JSON then the following field can override the project's JSON settings.

fileLayout

NORMAL The normal JSON file layout. First character in the file is a '{' followed by none or more JSON records each separated by a comma followed by a '}' as the last character in the file (default).

NO_ROOT_ARRAY The file is expected to contain only JSON records one after another. The file does not begin with a separate '{' character and does not have a separate '}' after the last JSON record. No characters (such as comma) separate each JSON record.
  

outCompression

The default value is taken from the project file's Compression setting in the Output file section. This parameter can be overridden using the values below.

NONE Output file shall not be compressed.

AS_INPUT The output file shall be created using the same compression as the input file (default).

GZIP Output file shall be gzip compressed.
  

projectKey

If the project is secured by a Project Key then this parameter must be supplied.

 

Example:

This example includes the projectKey parameter. It also includes the banner parameter so that FileMasker shall log a detailed banner at startup showing every relevant parameter for the masking project. The csvParams is also included and specifies an override of the project's CSV column separator character setting so that the TAB character is used.

{
      "inPath": "bucket/file.json",
      "outFolderPath": "bucket/outfolder/",
      "projectPath": "bucket/myproject.fmp",
      "licensePath": "bucket/license.fml",
      "region": "ap-southeast-2",
      "projectKey": "Mars.987Kilo&",
      "banner": "DETAIL",
      "csvParams": {
           "columnSeparator": "\t"
      }
 }

If you prefer to specify the ordinal number of a character rather than the actual character (or if it is not displayable) then in the example above the TAB character for columnSeparator could have been specified as shown below. Note that the double backslash is required because the first backslash is the Java escape character for the second backslash character.

                 "columnSeparator": "\\0x9"

 

  

 

 

 

Copyright © 2019-2021 DataVeil Technologies Pty Ltd