Skip to content

Commit 012e0c7

Browse files
committed
Create robots.txt by default
1 parent 97aaefe commit 012e0c7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

s3.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,22 @@ resource "aws_s3_bucket_cors_configuration" "files" {
5555
}
5656
}
5757

58+
variable "create_robots_txt" {
59+
type = bool
60+
default = true
61+
}
62+
63+
resource "local_file" "robots-txt" {
64+
count = var.create_robots_txt ? 1 : 0
65+
content = "User-agent: *\nDisallow: "
66+
filename = "${var.dist_folder}/robots.txt"
67+
}
68+
5869
module "template_files" {
5970
source = "hashicorp/dir/template"
6071

6172
base_dir = var.dist_folder
73+
depends_on = ["local_file.robots-txt"]
6274
}
6375
locals {
6476
content_type_overrides = {

0 commit comments

Comments
 (0)