DEV Community

Discussion on: How to deploy an application to AWS EC2 Instance using Terraform and Ansible.

Collapse
 
wparad profile image
Warren Parad • Edited

While this is good tutorial steps for doing as written, I wouldn't recommend this approach for modern apps:

  • for react, it's better to put it in an S3 bucket behind cloudfront so you get CDN with automated scaling. (even if you have SSR, you can do with the cloudfront lambda@edge)
  • EC2 are security vulnerabilities, if you have a service API based application, you should look to lambda with API gateway/cloudfront. If you really need a container, use ECS with fargate and then you don't have any servers to worry about. And future it completely eliminates the need to use Ansible.
Collapse
 
mariehposa profile image
Mariam Adedeji

Thank you.

I'll be sure to check out the suggestions you made.