Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Case 1: If the user provided an environment variable file path.

Consider this path as an example: (lambda-demo/EnvironmentFile/lambda-demo.json)

...

  • Consider the given path as an absolute path and check if a file exists on the given path.

  • If the file does not exist on the given path, then consider the path as a relative path and check the file in the Artifact directory. ( $FD_ARTIFACT_DIR/lambda-demo/EnvironmentFile/lambda-demo.json)

  • If no file is found using the above option, then check if the file is present under the temp Directory.

...

It can happen the file is present inside a zip file residing under the artifact folder(result of Consume Artifact). The plugin first extracts the content of the zip file under the temp directory. Then it will search the file pattern inside the temp File. (Any file path under $FD_TEMP_DIR ending withlambda-demo/EnvironmentFile/lambda-demo.json)

Note: While doing the pattern match for the file, in case more than one file is found then we are throwing the exception with the message: More than one environment Variable file present.

After performing above steps if we are not getting the file then we are throwing the exception. [ FDAWS_LAMBDA_00020_ADD_ENV_VARIABLE_FILE_NOT_FOUND, "File is not present on the given path: " + pGivenFilePath ]

Case 2: If no file path is given or the value of the file path is “NA”

Printing the message: LOG.logInfo(methodName, "Environment variable file path not provided or file path value is set as NA"); and continue the execution and check the input argument for environment variables.Example of Artifact directory, here we have both environment file and function code in our Artifact directory.

...

Artifact File Path ( Applicable only for local archive )

Case 1: If the user provided an Artifact file path.

Consider this path as an example: ( lambda-demo/FunctionCode/lambda-demo.zip )

...

${{FD_ARTIFACTS_DIR}}/lambda-demo/EnvironmentFile/lambda-demo.json

Example of Artifact directory file structure

Example-1: Here we have both environment file and function code in our Artifact directory.

...

Example-2: Users can also give a single Artifact file that contains both the Environment file and the zip file to update the function code. Just need to provide the right path pattern.

...