Skip to content

Commit

Permalink
fix length check
Browse files Browse the repository at this point in the history
  • Loading branch information
ssickles committed Feb 16, 2024
1 parent 76a1ac6 commit 1fbda6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cors.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_s3_bucket_cors_configuration" "example" {
count = len(var.cors_origins) > 0 && len(var.cors_methods) > 0 ? 1 : 0
count = length(var.cors_origins) > 0 && length(var.cors_methods) > 0 ? 1 : 0

bucket = aws_s3_bucket.this.id

Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF
}

variable "cors_origins" {
type = list(string)
type = set(string)
default = []
description = <<EOF
A set of origins that are allowed to make GET requests to this S3 bucket.
Expand All @@ -40,7 +40,7 @@ EOF
}

variable "cors_methods" {
type = list(string)
type = set(string)
default = ["GET"]
description = <<EOF
A set of HTTP verbs that are allowed to be used when making CORS requests to this S3 bucket.
Expand Down

0 comments on commit 1fbda6d

Please sign in to comment.