Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to fetch license key from AWS Secrets Manager and SSM Parameter Store with caching #120

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

gupta-yuvraj
Copy link

Overview

This PR introduces new functionality to support fetching New Relic license keys from multiple sources, including environment variables, AWS Systems Manager (SSM) Parameter Store, and AWS Secrets Manager. Additionally, it implements a caching mechanism to store the New Relic license key, preventing repeated fetches from Secrets Manager or SSM Parameter Store during every Lambda execution. The changes include updates to the Python source code, Terraform configuration, unit tests, and new policies for managing permissions and decryption.

Benefits

  • Flexibility: Supports configuring New Relic license keys from multiple secure sources, offering greater deployment flexibility.
  • Security: Utilizes AWS Secrets Manager and SSM Parameter Store, secure services for managing sensitive data.
  • Performance Optimization: Adds a caching mechanism to store the New Relic license key, reducing the need for frequent fetches and improving Lambda function performance.

Additional Features

  • Added the terraform variable nr_license_key_source to define the source of the license key (options: environment_var, ssm, secrets_manager) with a default value of environment_var.
  • Added the terraform variable enable_caching_for_license_key to toggle caching for the New Relic license key in the Lambda function.
  • Included permissions for fetching the license key from SSM Parameter Store and Secrets Manager.
  • Added a policy to decrypt the license key fetched from Secrets Manager using KMS keys.

Testing

  • Executed unit tests to verify that the New Relic license keys are correctly fetched from environment variables, Secrets Manager, and SSM Parameter Store.
  • Validated the caching mechanism to ensure that the license key is stored and retrieved correctly without unnecessary fetch operations.
  • Tested error handling for missing or invalid secrets/parameters and ensured proper decryption of the license key using KMS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants