Skip to content

Commit 942a46e

Browse files
committed
chore: configure routing rules in s3 website configuration
1 parent 9dc3492 commit 942a46e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

terraform/website/main.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ resource "aws_s3_bucket_website_configuration" "bucket" {
3838
error_document {
3939
key = "error.html"
4040
}
41+
42+
routing_rules = jsonencode([
43+
{
44+
Condition {
45+
KeyPrefixEquals = "colorcop/download"
46+
}
47+
Redirect {
48+
ReplaceKeyWith = "download"
49+
}
50+
},
51+
{
52+
Condition {
53+
KeyPrefixEquals = "colorcop/features"
54+
}
55+
Redirect {
56+
ReplaceKeyWith = "features"
57+
}
58+
}
59+
])
4160
}
4261

4362
resource "aws_cloudfront_distribution" "distribution" {

0 commit comments

Comments
 (0)