diff --git a/tform/blog/main.tf b/tform/blog/main.tf index e3791f3..b485eba 100644 --- a/tform/blog/main.tf +++ b/tform/blog/main.tf @@ -1,5 +1,5 @@ resource "aws_s3_bucket" "blog" { - bucket = "blog.ndumas.com" + bucket = var.domain force_destroy = true } @@ -21,7 +21,7 @@ resource "aws_s3_bucket_cors_configuration" "blog_cors" { cors_rule { allowed_headers = ["*"] allowed_methods = ["GET"] - allowed_origins = ["https://blog.ndumas.com", "http://blog.ndumas.com"] + allowed_origins = ["https://{var.domain}", "http://{var.domain}"] max_age_seconds = 3000 } } @@ -54,7 +54,7 @@ resource "aws_iam_policy" "blog_bucket_policy" { ], "Resource" : [ "arn:aws:s3:::*/*", - "arn:aws:s3:::blog.ndumas.com" + "arn:aws:s3:::{var.domain}" ] } ] diff --git a/tform/blog/variables.tf b/tform/blog/variables.tf new file mode 100644 index 0000000..e1ef504 --- /dev/null +++ b/tform/blog/variables.tf @@ -0,0 +1,3 @@ +variable "domain" { + type = string +}