Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

AWS Serverless Sharing Configuration Data


Sharing Configuration Data in a Serverless Environment

In a microservice architecture, communication between services and functions is critical.

A service requires configuration or connection data to communicate with another service.

Handling configuration data or secrets in code is a common problem for developers.

These include connection strings, logging options, and outputs.

This data may be sensitive, so don't unintentionally check it into source code or distribute it.

When working with sensitive data such as configuration data, there are several deployment options:

  • This data can be hardcoded in your code
  • You can use environment variables
  • You can use the runtime load of this data

Never hardcode secrets or configuration data in your application code.

Loading data at runtime increases latency, keeping sensitive data out of your code.

It is a best practice.


Sharing Configuration Data in a Serverless Environment Video

W3schools.com collaborates with Amazon Web Services to deliver digital training content to our students.


Environment Variables

An Environment variable is a dynamically named item that can change how a program behaves.

When using Lambda, keep configuration parameters separate from your code.

AWS Key Management Service can encrypt these values.

Because environment variables are function-specific, setting up Lambda functions is impossible.

Environment variables must be updated in all Lambda functions using them.


AWS Systems Manager Parameter Store

One solution for configuration data is AWS Systems Manager Parameter Store.

It is a free, fully managed, centralized storage system for configuration data management.

Parameter Store tracks all parameter changes through versioning.

Never keep sensitive data in code or environment variables.

Use Systems Manager Parameters to store your secrets and shared configuration settings.

However, Parameter Store may increase latency.

Therefore, you should benchmark your function to identify the best technique.

One of the techniques to address performance issues is using AWS X-Ray.


Related reads:

What Is AWS Secrets Manager?
AWS Systems Manager FAQs
Sharing Secrets with AWS Lambda Using AWS Systems Manager Parameter Store
AWS Lambda Environment Variables

AWS Serverless Exercises

Test Yourself With Exercises

Exercise:

What is environment variable?

A dynamically  item that can  how a program 

Start the Exercise


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.