Versions Compared

Key

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

...

After configuration we would be able to use the Cloud Account as a drop down from the list.

...

...

Create AWS Lambda Function

AWS Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, and logging. With Lambda, all you need to do is supply your code in one of the language runtimes that Lambda supports. Please refer to the link for more information https://docs.aws.amazon.com/lambda/latest/dg/welcome.html

To create the Lambda Function go to the AWS console

  1. Navigate to the Services

  2. Select Compute from the left-hand pane

  3. Now click on the Lambda service option

...

After selecting the Lambda service, new window will open and it contains detail of all the functions.

...

Now select the create function option, it will open window to create function and configured detail.

...

By default AWS creates execution role with basic Lambda permissions, we can select an existing role also. In above example we are using existing role ( basic-lambda-role ) . Please refer to the link for more information https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html

The role which we are selecting must have basic Lambda permissions, the role we have selected also have permission for KMS key to decrypt the secured variables. If we are using the KMS key to encrypt the secured variables then we must have to give permission to the role to use the KMS key.

...

In above role we can see we have one permissions policy name as kms-access, this policy allow us to use the KMS key to decrypt the variables, which we have used to encrypt the variables.

Policy detail:

...

Trust relationships detail: ( Entities that can assume this role under specified conditions )

...

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 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/

AWS KMS key is required to encrypt the secured variables before adding them to Lambda function. If we don’t have any secured variables in that case we don’t required to configure KMS key detail in the project. In our scenario we are adding both secured and non-secured variables to the Lambda function.

To create the Lambda Function go to the AWS console

  1. Navigate to the Services

  2. Select Security, Identity, & Compliance from the left-hand pane

  3. Now click on the Key Management Service service option

...

Detail of the KMS key which we are using for this tutorial:

...

We can use Key ID or Key ARN value in the project to encrypt the variables, both are accepted.

Git repository structure

The Git repository contains the Environment file.

...

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

...

Image RemovedImage Added

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

...