Xóa bài viết
Bạn có chắc chắn muốn xóa bài viết này không ?
Xóa bình luận
Bạn có chắc chắn muốn xóa bình luận này không ?
Minimum Web App Terraform Skeleton
I made a Skeleton for Terraform code. Basically I'm supposed to use it for future projects, but then just thought it might be useful for others so that want to share it with you. Also I tried to avoid having to copy and paste codes when deploye in multiple environments for same app. Hopefully, you will be able to reuse at least a part or an idea to help you with your work.
Directory layout
|--.gitignore
|--README.md
|--_resources
| |--ec2.tf
| |--network.tf
| |--rds.tf
| |--s3.tf
| |--sg.tf
| |--variables.tf
|--prod
| |--main.tf
|--test
| |--main.tf
Check the source code here
https://github.com/chienkira/minimum-web-app-terraform-skeleton
Minimum-web-app-terraform-skeleton
Minimum Terraform skeleton (sample) for web app
Features
- All resources are defined as terraform module (D-R-Y infra code)
- Allow you create same infra for both test and prod environments with only 1 command
- Comes with minimum setup, you can add everything you need, also custom all settings
- This skeleton uses EC2 as web server, RDS as database server and S3 as file storage
- Allocate EIP and assign static IP address to your EC2 instance so it's easier for you to setup domain stuffs after
- Create a new VPC for your web app (good practise to not use the default VPC)
How to deploy
$ # checkout this repository $ cd test # change to directory of enviroment you want to create (test or prod environment) $ terraform init && terraform plan # check what resources will be create $ terraform apply # apply (deploy) all resources
All comments and feedback are welcome.
bài viết gốc có ở blog của mình: https://chienkira.github.io/blog/posts/minimum-web-app-terraform-skeleton/
Bình luận

{{ comment.user.name }}
Bỏ hay
Hay

Cùng một tác giả

16
1
Lập trình viên không sớm thì muộn cũng sẽ yêu cái máy tính không khác gì yêu vợ. Rồi ngày qua ngày tiếp xúc với cửa sổ dòng lệnh, mắt lập trình viê...

13
2
Blue green deployment là cái khỉ ho gì? Nó có gì hay và có "ngon" không? Nếu bạn đang có câu hỏi tương tự trong đầu thì hãy thử đọc hết bài viết n...

5
0
Unpack trong python Link bài viết gốc ở blog của mình: (Link) Ký tự ngoài là toán tử multiplication (phép nhân) và string replication ra, trong...
Bài viết liên quan

3
0

2
0
Bài viết gốc có ở blog của mình: (Link) Trong bài viết này, mình muốn giới thiệu về module trong terraform, và cách sử dụng nó để deploy lên nhiều...