user1791139
user1791139

Reputation: 646

AWS Elastic Beanstalk NodeJS Project access S3 Bucket

i want to access S3 Bucket from my NodeJS application without write and commit the credentials for this Bucket in my application. I see that it is possible to set a .config file in the .elasticbeanstalk folder where you can specified RDS databases. In the application you can use this this RDS without set any credentials with variables like process.env.RDS_HOSTNAME. I want the same with S3 Bucket, but process.env.S3_xxx doesn't work. How should the .config look?

Upvotes: 1

Views: 703

Answers (1)

azero0
azero0

Reputation: 2310

Alternatively,

you can explicitly set an environment variable from elasticbeanstalk at http://console.aws.amazon.com

Step 1: go to the above url login and open your elasticbeanstalk app.

Step 2: open the configuration tab and in that open software configuration.

Step 3 : scroll to environment properties and add your variable there i.e Property Name:S3_xxx,Property Value:"whatever value".

now you can access this variable in your app using process.env.S3_xxx without any .config in your app.

Upvotes: 1

Related Questions