Versions Compared

Key

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

...

The goal of the tutorial is to deploy the function code using the Archive file from the Artifact directory and publish the function version. We will use the Function code and Environment file present at the git repository. We are going to add secured variables also and to encrypt these variables, we will use the AWS KMS key.

  • configuration of the properties e.g. Cloud account, and CLI path.

  • cloning the function code and create the Archive file.

  • cloning the environment file from Git repository

  • deploy the function code and adding the environment variables to the Lamba function.

  • verify the function code.

...

Detail of the AWS Lambda function which we have created and going to use for this tutorial:

...

In above function if we see the Environment variables details under the Configuration, there is no environment If we check the Code details of the function, then we found we have sample code. We will update the code using our AWS plugin operation.

...

On testing the code, using the Test option provided by AWS Lambda we will get this response:

...

If we check the Environment variables details under the Configuration, there is no environment variables are present. Once successful execution of the operation we should be able to see some environment variables.

...

Create AWS KMS Key

AWS Key Management Service (AWS KMS) is a managed service that makes it easy for us to create and control the cryptographic keys that are used to protect our data. Please refer to the link for more information https://aws.amazon.com/kms/

...

The Sample Git repository structure is given below.

...

Environment Variable File Structure

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

...

Configure the Build and Deploy workflow that has been created in previous steps as shown below.

...

Source Control

Configure the Source SCM repository under Source Control as shown below.

...

Once the updateLambdaFunctionCode operation successful we can see the updated code and published version , from the plugin output and AWS Lambda console.

Updated code details from AWS Lambda console.

...

Published version detail from AWS Lambda console.

...

Published version detail from the plugin output.

...

We can see the variable details on the AWS Lambda Function console.

...