diff --git a/database/main.tf b/database/main.tf index f63288f..3cd448a 100644 --- a/database/main.tf +++ b/database/main.tf @@ -111,8 +111,9 @@ resource "aws_db_parameter_group" "postgres" { # Enable pg_stat_statements for extra analytics parameter { - name = "shared_preload_libraries" - value = "pg_stat_statements" + name = "shared_preload_libraries" + value = "pg_stat_statements" + apply_method = "pending-reboot" } parameter { @@ -121,8 +122,9 @@ resource "aws_db_parameter_group" "postgres" { } parameter { - name = "track_activity_query_size" - value = "2048" + name = "track_activity_query_size" + value = "2048" + apply_method = "pending-reboot" } } diff --git a/static_site/main.tf b/static_site/main.tf index a31c669..db0fbc5 100644 --- a/static_site/main.tf +++ b/static_site/main.tf @@ -52,9 +52,10 @@ resource "aws_s3_bucket" "site_content_bucket" { } POLICY + # Serve index.html on errors to support client side routing, e.g. React Router website { index_document = "index.html" - error_document = "error.html" + error_document = "index.html" } tags { @@ -77,6 +78,19 @@ resource "aws_cloudfront_distribution" "s3_distribution" { aliases = ["${var.subdomain}.${var.domain_name}"] + # Serve index.html on errors to support client side routing, e.g. React Router + custom_error_response { + error_code = 403 + response_code = 200 + response_page_path = "/index.html" + } + + custom_error_response { + error_code = 404 + response_code = 200 + response_page_path = "/index.html" + } + default_cache_behavior { allowed_methods = ["GET", "HEAD", "OPTIONS"] cached_methods = ["GET", "HEAD"] @@ -155,9 +169,10 @@ resource "aws_s3_bucket" "preview" { } POLICY + # Serve index.html on errors to support client side routing, e.g. React Router website { index_document = "index.html" - error_document = "error.html" + error_document = "index.html" } tags {