Skip to content

Commit

Permalink
chore: readded cors_config
Browse files Browse the repository at this point in the history
  • Loading branch information
david tjokroaminoto committed Apr 5, 2024
1 parent 0cb2729 commit e604275
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ resource "aws_cloudfront_origin_access_control" "main" {
resource "aws_cloudfront_response_headers_policy" "web_dist" {
name = "${var.service_name}-policy"

cors_config {
access_control_allow_credentials = false

access_control_allow_headers {
items = ["*"]
}

access_control_allow_methods {
items = ["GET", "HEAD", "POST", "OPTIONS"]
}

access_control_allow_origins {
items = var.cors_allowed_origins
}

origin_override = true
}

security_headers_config {
content_security_policy {
content_security_policy = var.content_security_policy
Expand Down

0 comments on commit e604275

Please sign in to comment.