Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Commit

Permalink
Saber (#36)
Browse files Browse the repository at this point in the history
* Fix static db parameters

* Fix underscore to hyphen typo

* Direct to index.html on errors to support react router
  • Loading branch information
robertfairhead authored May 23, 2019
1 parent fdfeee5 commit cd0e3a7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
10 changes: 6 additions & 4 deletions database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
}
}

Expand Down
19 changes: 17 additions & 2 deletions static_site/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"]
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cd0e3a7

Please sign in to comment.