~repos /website
git clone https://pyrossh.dev/repos/website.git
木 Personal website of pyrossh. Built with astrojs, shiki, vite.
0d04c012
—
pyrossh 6 months ago
add terraform code
- .gitignore +3 -0
- infra/main.tf +13 -4
.gitignore
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
dist/
|
|
3
3
|
# generated types
|
|
4
4
|
.astro/
|
|
5
|
+
.terraform
|
|
6
|
+
terraform.tfstate
|
|
7
|
+
terraform.tfstate.backup
|
|
5
8
|
|
|
6
9
|
# dependencies
|
|
7
10
|
node_modules/
|
infra/main.tf
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_providers {
|
|
3
|
+
aws = {
|
|
4
|
+
source = "hashicorp/aws"
|
|
5
|
+
version = "= 5.99.1"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
provider "aws" {
|
|
2
11
|
region = "ap-south-1"
|
|
3
12
|
default_tags {
|
|
@@ -150,10 +159,10 @@ resource "aws_cloudfront_distribution" "s3_distribution" {
|
|
|
150
159
|
min_ttl = 0
|
|
151
160
|
default_ttl = 3600
|
|
152
161
|
max_ttl = 86400
|
|
153
|
-
|
|
162
|
+
function_association {
|
|
154
|
-
|
|
163
|
+
event_type = "viewer-request"
|
|
155
|
-
|
|
164
|
+
function_arn = aws_cloudfront_function.subdirectory_redirector.arn
|
|
156
|
-
|
|
165
|
+
}
|
|
157
166
|
}
|
|
158
167
|
price_class = "PriceClass_All"
|
|
159
168
|
restrictions {
|