This commit is contained in:
Greyscale 2024-12-06 20:28:25 +01:00
parent 3cfdf488d0
commit 18872cfceb
Signed by: grey
GPG key ID: DDB392AE64B32D89
3 changed files with 8 additions and 9 deletions
cloud/aws/s3_bucket
products/docker_registry

View file

@ -5,11 +5,10 @@ resource "aws_s3_bucket" "bucket" {
resource "local_file" "debug" {
filename = "${path.root}/.debug/aws/s3_bucket/bucket.${aws_s3_bucket.bucket.bucket}.yml"
content = yamlencode({
bucket_prefix = var.bucket_name_prefix,
tags = local.tags,
endpoint = aws_s3_bucket.bucket.bucket_domain_name
})
content = yamlencode({
bucket_prefix = var.bucket_name_prefix,
tags = local.tags,
endpoint = aws_s3_bucket.bucket.bucket_domain_name
})
file_permission = "0600"
}

View file

@ -41,7 +41,7 @@ variable "domain" {
description = "The domain for the registry"
}
variable "cors_domains" {
type = list(string)
type = list(string)
description = "A list of domains to allow CORS requests from"
default = []
default = []
}

View file

@ -15,7 +15,7 @@ locals {
secret = nonsensitive(random_password.http_secret.result)
host = var.domain
headers = {
Access-Control-Allow-Origin = concat(["https://${var.domain}", ], formatlist("https://%s",var.cors_domains))
Access-Control-Allow-Origin = concat(["https://${var.domain}", ], formatlist("https://%s", var.cors_domains))
Access-Control-Allow-Methods = ["HEAD", "GET", "DELETE", "OPTIONS"]
Access-Control-Allow-Credentials = ["true"]
Access-Control-Allow-Headers = ["Authorization", "Cache-Control", "Accept"]