Skip to content

Commit

Permalink
Adjust timeout for Lambda Tilegarden and Run terraform fmt
Browse files Browse the repository at this point in the history
* Adjust Lambda Tilegarden CDN origin so that its timeout matches
  the lambda function timeout
* Run terraform fmt to clean up some bad formatting
  • Loading branch information
Jean Cochrane committed Jan 30, 2019
1 parent 6282f7a commit 766f429
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions deployment/terraform/cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "aws_cloudfront_distribution" "tilegarden" {
https_port = 443
origin_protocol_policy = "https-only"
origin_ssl_protocols = ["TLSv1.2", "TLSv1.1", "TLSv1"]
origin_read_timeout = 60
}

domain_name = "${var.tilegarden_api_gateway_domain_name}"
Expand All @@ -18,8 +19,9 @@ resource "aws_cloudfront_distribution" "tilegarden" {

origin {
custom_origin_config {
http_port = 80
https_port = 443
http_port = 80
https_port = 443

# S3 websites don't support TLS :/
origin_protocol_policy = "http-only"
origin_ssl_protocols = ["TLSv1.2", "TLSv1.1", "TLSv1"]
Expand Down
6 changes: 3 additions & 3 deletions deployment/terraform/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ resource "aws_iam_role_policy_attachment" "ecs_for_ec2_policy_container_instance
}

resource "aws_iam_instance_profile" "app_container_instance" {
name = "${aws_iam_role.app_container_instance_ec2.name}"
role = "${aws_iam_role.app_container_instance_ec2.name}"
name = "${aws_iam_role.app_container_instance_ec2.name}"
role = "${aws_iam_role.app_container_instance_ec2.name}"
}

#
Expand All @@ -189,6 +189,6 @@ resource "aws_iam_role_policy_attachment" "batch_ec2_s3_policy" {
}

resource "aws_iam_instance_profile" "batch_container_instance" {
name = "${aws_iam_role.batch_container_instance_ec2.name}"
name = "${aws_iam_role.batch_container_instance_ec2.name}"
role = "${aws_iam_role.batch_container_instance_ec2.name}"
}
8 changes: 5 additions & 3 deletions deployment/terraform/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ resource "aws_s3_bucket" "storage" {
}

lifecycle_rule {
id = "osm_extracts"
id = "osm_extracts"
enabled = true
prefix = "/osm-data-cache"
prefix = "/osm-data-cache"

expiration {
days = 7
}
Expand All @@ -58,7 +59,8 @@ resource "aws_s3_bucket" "tile_cache" {

website {
index_document = "index.html"
routing_rules = <<EOF

routing_rules = <<EOF
[{
"Condition": {
"HttpErrorCodeReturnedEquals": "404"
Expand Down
1 change: 1 addition & 0 deletions deployment/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ variable "pfb_app_alb_ingress_cidr_block" {

# CloudFront distribution
variable "tilegarden_api_gateway_domain_name" {}

variable "cloudfront_price_class" {
default = "PriceClass_100"
}

0 comments on commit 766f429

Please sign in to comment.