Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The goal of this tutorial is to add the environment variables and publish the function version. We will also add secured variables, and to encrypt these variables we are going to use the AWS KMS key. We will have a project property added in the deploy workflow and this project property value will contain the list of the environment variables that we are going to use in the workflow input. We can use the dynamic value in both the environment file and input argument, please refer to this document to get more details about environment variables' acceptable structure: AWS Lambda Environment Variables Accepted Structure. These are the general steps we’ll follow:

...

This is the example of environment file with json structure, please refer the document to get more details about environment variables' acceptable structure.

...

Pre-requisite

Configure IAM User

...

Below given is a sample build workflow to copy the file from Git repository.

...

Step-i: Clone Git Repository
This step will clone the Git repository codebase into the project execution working directory. The Git URL will be retrieved from Source Control configured under Project Configuration.

...

Step-ii: Copy the environment file
The below step will copy the environment file to the artifacts directory. Make sure to check the Produces Artifact option to save the files as artifact so that can be used from Deploy workflow.

...

Below given is a sample deploy workflow to add the environment variable to the AWS Lambda function.

...

Step-i: add environment variables

This step will add environment variables to the Lambda Function and publish the version.

...

  1. To configure Project specific Source Control one first need to navigate to the Project Configuration tab.

  2. Next, expand the SOURCE CONTROL option from the left-hand pane.

  3. Select the appropriate Source Control Type

  4. Configure Source Repository. For detailed steps of Source Control configuration please refer to Configure Source Control in FlexDeploy

Project Properties

...

Lambda Function name: Name of the Function to add the environment variables, if lambda function name is not given name of the environment file will be use as function name.

...

For detailed steps on how to perform build and deploy, please refer to document. Deploy through FlexDeploy for AWS plugin

After Deploy Execution

Once the add environment operation successful we can see the variable details on the AWS Lambda Function console.

...