parameterized domain for terraform code

main
Nick Dumas 2 years ago
parent c6dad9669a
commit fc47988ed2

@ -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}"
]
}
]

@ -0,0 +1,3 @@
variable "domain" {
type = string
}
Loading…
Cancel
Save