Skip to content

Commit

Permalink
fix(ci): include robots.txt in TF storage configuration for static/re…
Browse files Browse the repository at this point in the history
…ports subdomains (#1278)
  • Loading branch information
dgrebb committed Apr 24, 2024
1 parent 6d24b5a commit 0718e6c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _tf/modules/reports/reports.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ resource "aws_s3_object" "index_html" {
etag = filemd5("${path.module}/index.html")
}

resource "aws_s3_object" "robots_txt" {
bucket = aws_s3_bucket.reports.id
key = "robots.txt"
source = "${path.module}/robots.txt"
content_type = "text/plain"
etag = filemd5("${path.module}/robots.txt")
}

resource "aws_s3_object" "error_html" {
bucket = aws_s3_bucket.reports.id
key = "404/index.html"
Expand Down
2 changes: 2 additions & 0 deletions _tf/modules/reports/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
8 changes: 8 additions & 0 deletions _tf/modules/storage/defaults/defaults.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ resource "aws_s3_object" "notfound_img" {
etag = filemd5("${path.module}/files/404.gif")
}

resource "aws_s3_object" "robots_txt_cdn" {
bucket = var.bucket.id
key = "robots.txt"
source = "${path.module}/../../reports/robots.txt"
content_type = "text/plain"
etag = filemd5("${path.module}/../../reports/robots.txt")
}

0 comments on commit 0718e6c

Please sign in to comment.