DEV Community

Discussion on: Injecting Angular Environment Variables at Build Time

Collapse
 
talr98 profile image
Tal Rofe

Why don't you use SSM Paramater store, to store those secrets?

Collapse
 
valoni01 profile image
Valentine Awe

Thanks for asking. like I said in the article, secrets should not be stored in the frontend application. There are other environment variables that you need to and Angular expect these variables to be injected to your application at build time

Collapse
 
talr98 profile image
Tal Rofe

Yes but those are really not secrets. It's a front-end application. Whatever env variable you would eventually use, it would be plaintext for the client-browser anyway.

So what I'm asking is basically - why wouldn't you store these variables (which are not secrets tho) in the SSM Parameter store? Why did you choose S3?

Thread Thread
 
valoni01 profile image
Valentine Awe

Great.. I thought you suggested SSM because of security. It is absolutely fine to store the variables anywhere. As long as you can extract the variables at build time from your build process and inject to the code

Thread Thread
 
talr98 profile image
Tal Rofe

Is there any critical reason you chose S3 over SSM?

Thread Thread
 
valoni01 profile image
Valentine Awe

For me, it was simplicity. I can easily manage the the folders and environment files in S3. I guess with the SSM param store you will have to write the logic of reading the parameters from a path in your store and then create your environment files on the fly and also write the parameters to the created file.
with the s3, we just have to copy.