You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1
+
# Next.js on AWS Fargate with Terraform
2
+
3
+

2
4
3
-
## Getting Started
5
+
## Architecture
4
6
5
-
First, run the development server:
7
+
See the [Terraform code](./infra/main.tf) for the full architecture.
6
8
7
-
```bash
8
-
npm run dev
9
-
# or
10
-
yarn dev
11
-
# or
12
-
pnpm dev
13
-
# or
14
-
bun dev
15
-
```
16
-
17
-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
-
19
-
You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20
-
21
-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
9
+
- A VPC with public, private, private isolated subnets
10
+
- An ECS cluster with a Fargate service
11
+
- A Route 53 private hosted zone for the ECS service (AWS CloudMap/Service Discovery)
12
+
- API Gateway w/ VPC Link Integration to the ECS service using the private DNS name
13
+
- An ECS task definition with a container that runs the Next.js app
14
+
- A CloudFront distribution with an API Gateway origin
22
15
23
-
## Learn More
16
+
## Deploy to AWS with Terraform
24
17
25
-
To learn more about Next.js, take a look at the following resources:
18
+
First, you need to install Terraform. You can download it from [here](https://www.terraform.io/downloads.html).
26
19
27
-
-[Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
-
-[Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
20
30
-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
-
32
-
## Deploy on Vercel
21
+
```bash
22
+
cd infra
23
+
# Initialize the Terraform providers
24
+
terraform init
25
+
# See the changes that will be applied
26
+
terraform plan
27
+
# Apply the changes to your default AWS profile
28
+
terraform apply
29
+
```
33
30
34
-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
31
+
You can also use a different AWS profile by setting the `AWS_PROFILE` environment variable.
35
32
36
-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
0 commit comments