Deploy your Symfony application on AWS Elastic Beanstalk using CloudFormation best php training trivandrum
Deploy your Symfony application on AWS Elastic Beanstalk using CloudFormation
The problem
- Be setup in less than 10min
- Be able to run a Symfony application
- Using PostgreSQL on RDS
- Deployment is easy and fast
- Non AWS experts can create the MVS
Elastic Beanstalk
CloudFormation
database_host: "%env(DB_HOST)%"
database_port: 5432
database_name: "%env(DB_NAME)%"
database_user: "%env(DB_USER)%"
database_password: "%env(DB_PASSWORD)%"
zip -r code.zip . --exclude=*vendors*`
Step 7: Click on “next”, “next” and check “I acknowledge that AWS CloudFormation might create IAM resources.”. Then you can click on create. If everything is fine then you should see something like this:
Step 8 : You can check the Elastic Beanstalk page to see if everything went okay and find the url of your project at the top of the page.
Configure the Elastic Beanstalk environment
- Ensure you don’t have a .elasticbeanstalk directory
- Run “eb init“, choose your region and the application you just created. You can find the name in the Elastic Beanstalk page.
Conclusion
Bonus: tips to debug your elastic beanstalk application
- If you are using GIT, to deploy the app on your EB instance, you may need to create a branch called “codecommit-origin”
- You can get the logs of the app in the EB service on the aws console
- The code that is deployed on your EB instances is automatically stored in a S3 bucket that you can access on the AWS console
- You can ssh into the EB instance with the “eb ssh” command
- The application user is webapp and you can get a bash with the following command: “sudo -u webapp /bin/bash”. It’s useful if you want to use the Symfony command without being root.
- If you create through the aws console a RDS database the default name of the database is ebdb. You can find it in the RDS service in the aws console
Comments
Post a Comment