Skip to content

Commit

Permalink
build: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrauneck committed May 13, 2024
1 parent 82304ef commit 8757757
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
15 changes: 5 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.2.0
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -32,25 +32,20 @@ repos:
args:
- -b main
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.0
rev: v1.89.1
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_docs
args:
- --hook-config=--path-to-file=README.md
- --hook-config=--add-to-existing-file=true
- --hook-config=--create-file-if-not-exist=true
- repo: https://github.com/Checkmarx/kics
rev: v1.5.4
hooks:
- id: kics
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.13.0
rev: 0.28.3
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier
stages: [commit]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Please be aware that this is mainly a copy operation which means all your curren

| Name | Source | Version |
|------|--------|---------|
| <a name="module_bucket"></a> [bucket](#module\_bucket) | git::github.com/xoap-io/terraform-aws-storage-s3.git | v0.1.0 |
| <a name="module_bucket"></a> [bucket](#module\_bucket) | git::github.com/xoap-io/terraform-aws-storage-s3.git | v0.1.1 |
| <a name="module_this_label"></a> [this\_label](#module\_this\_label) | git::github.com/xoap-io/terraform-aws-misc-label | v0.1.0 |

## Resources
Expand All @@ -127,6 +127,7 @@ Please be aware that this is mainly a copy operation which means all your curren
| [aws_cloudfront_cache_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_cache_policy) | resource |
| [aws_cloudfront_distribution.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution) | resource |
| [aws_cloudfront_origin_request_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_origin_request_policy) | resource |
| [aws_cloudfront_response_headers_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_response_headers_policy) | resource |

## Inputs

Expand Down
43 changes: 32 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module "this_label" {
attributes = ["hosting", var.site_name]
}
module "bucket" {
source = "git::github.com/xoap-io/terraform-aws-storage-s3.git?ref=v0.1.0"
source = "git::github.com/xoap-io/terraform-aws-storage-s3.git?ref=v0.1.1"
context = var.context
name = var.site_name
website_enabled = true
Expand Down Expand Up @@ -49,6 +49,29 @@ resource "aws_cloudfront_origin_request_policy" "this" {
}
query_strings_config {
query_string_behavior = "all"

}

}
resource "aws_cloudfront_response_headers_policy" "this" {
name = module.this_label.id

cors_config {
access_control_allow_credentials = false

access_control_allow_headers {
items = var.cors_allowed_headers
}

access_control_allow_methods {
items = concat(var.cors_allowed_methods, ["OPTIONS"])
}

access_control_allow_origins {
items = var.cors_allowed_origins
}

origin_override = true
}
}
#tfsec:ignore:AWS045
Expand Down Expand Up @@ -77,16 +100,14 @@ resource "aws_cloudfront_distribution" "this" {
default_root_object = var.default_root_object
aliases = var.cloudfront_aliases
default_cache_behavior {
allowed_methods = var.allowed_methods
cached_methods = var.cached_methods
target_origin_id = var.s3_origin_id
compress = true
cache_policy_id = aws_cloudfront_cache_policy.this.id
origin_request_policy_id = aws_cloudfront_origin_request_policy.this.id
viewer_protocol_policy = var.viewer_protocol_policy
min_ttl = var.cf_min_ttl
max_ttl = var.cf_max_ttl
default_ttl = var.cf_default_ttl
allowed_methods = var.allowed_methods
cached_methods = var.cached_methods
target_origin_id = var.s3_origin_id
compress = true
cache_policy_id = aws_cloudfront_cache_policy.this.id
origin_request_policy_id = aws_cloudfront_origin_request_policy.this.id
viewer_protocol_policy = var.viewer_protocol_policy
response_headers_policy_id = aws_cloudfront_response_headers_policy.this.id
}
price_class = var.cf_price_class
viewer_certificate {
Expand Down

0 comments on commit 8757757

Please sign in to comment.