Get more updates and further details about your project right in your mailbox.
The best time to establish protocols with your clients is when you onboard them.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
Amazon Web Services (AWS) Parameter Store is a service that enables you to store, retrieve, and manage configuration data for your AWS resources and applications. It allows you to store data such as passwords, database connection strings, and API keys in a secure, centralized location, making it easy to access and manage it from a single location.
Use case of Parameter Store
Problems with saving your secret configuration in .env files or Lambda-Environment-Variables
How these problems can be resolved by the Parameter store
Types of Parameters
Standard and Advance Parameters : courtesy-AWS
Features of Advanced Parameters
1. We can write policies for parameters and set expiration time at parameter level.
2. We can set up notifications for parameters when they are about to expire.
3. You can set up a policy to receive a notification if a parameter has not changed in a while and you can define the time for when that parameter has to change.
Pricing
There are two costs involved :-
2. API Interaction to get the parameter (same for both type of parameter).
How Parameter Store records every change
Versions of Parameter
Here you can see in the above image that we have versions for every change. Here is just one change with the last modified date and last modified user, so we know when it was modified and who that user was.
How we can plan the Structure of our Parameters to store
Structure of Parameters on store : courtesy-AWS
In the above image you can see we can define our parameter store in a tree- like structure and give access according to our need, for example :-
We can plan our key structure as shown for every environment :-
1 : test
2 : staging
3 : dev
4 : prod
And can give access policy accordingly or as we need.
How we can access our parameter through this hierarchy in JavaScript:
Access parameter through this hierarchy
And we get our values as:
Now the last question is how our lambda will access the parameter store for the aws access key and secret key:
1. Create Parameters first.
2. Create New IAM permission for accessing SSM parameters(Variable) from lambda.
3. Create Lambda function: use SSM Javascript SDK to read/update SSM parameters.
Code will be somewhat like this:
Code to access Parameters from Lambda