2

I am using AWS for my Laravel Application but I am having a difficult time with dealing with my .env file.

I make use of CodeCommit and CodePipeline.

I know that my .env file should NOT live inside my repo so my question is, is there a way I can get AWS to insert a .env file whilst CodePipeline is deploying my project to Elastic Beanstalk?

At the moment, I am having to include my .env file in my repo for it to work.

oluwatyson
  • 251
  • 4
  • 18

2 Answers2

2

Right, I was able to get the answer from this link. https://andrewhuggins.com/post/deploying-laravel-with-elastic-beanstalk-env

Basically, within Elastic Beanstalk, you have an option under Configuration > Software and then click 'Edit' button. Scroll all the way down and you'll see Environment Properties...This will be effectively your .env file. Copy and paste each variable and value pair within this and then click save.

oluwatyson
  • 251
  • 4
  • 18
0

You can rebuild .env from the configuration stored under SSM, or you can store the .env file inside the s3 bucket, the bucket will restrict access to the CodePipeline role

AWS PS
  • 4,420
  • 1
  • 9
  • 22