1

I am writing a small webapi in c#, that using mongodb as the storage, and I am wondering where to store the connection string. I know I can use the webconfig, and change between configuration per debug and release. But, I found this link that show how to load java properties file from a s3 bucket.

So I am wondering if it also possible when using beanstalk, and if so - does this is the best practices? This is the first time I am deploying something to aws, until now I used azure, where you can use the cscfg file for that purpose.

Thanks, Omer

Omer Levi Hevroni
  • 1,935
  • 1
  • 15
  • 33

1 Answers1

1

I saw that the question was not answered. I think that the proper way to achieve seems to be using environment variable, see this for example. If you had any better idea, I would like to hear.

Community
  • 1
  • 1
Omer Levi Hevroni
  • 1,935
  • 1
  • 15
  • 33
  • I found two alternative: a) store the connection strings in s3 and allow only the role associated with the ec2 access it. b) encrypt the web.config using Aspnet_regiis.exe. I solved it in azure by storing all sensitive data as secrets in the KeyVault which is also a nice solution. – Omer Levi Hevroni Jun 14 '16 at 13:41