From 109b0770c70ce4225de4e7e6613f875e7a5c0b17 Mon Sep 17 00:00:00 2001 From: eternaltyro Date: Fri, 1 Dec 2023 11:12:31 +0000 Subject: [PATCH] Increase API load balancer timeout - Increase API Backend load balancer timeout from 60s to 180s - Bump PostgreSQL engine version for AWS RDS from 11.19 to 13.10 - Cleanup unused Route53 entry (must be removed) - Enable HTTP/2 in API Backend load balancer explicitly (no infra change) - Add experimental dummy Route53 entries to new tasks.hotosm.org hosted zone. Both A and AAAA resource records are added --- .../tasking-manager.template.js | 54 +++++++++++++------ 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index 7c66644165..b35e9a762e 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -15,8 +15,9 @@ const Parameters = { Type: 'String' }, NetworkEnvironment: { + Description: "Legacy parameter aka Deployment Environment", Type :'String', - AllowedValues: ['staging', 'production'] + AllowedValues: ['demo', 'staging', 'production'] }, AutoscalingPolicy: { Type: 'String', @@ -51,7 +52,7 @@ const Parameters = { DatabaseEngineVersion: { Description: 'AWS PostgreSQL Engine version', Type: 'String', - Default: '11.19' + Default: '13.10' }, DatabaseInstanceType: { Description: 'Database instance type', @@ -174,6 +175,11 @@ const Parameters = { Description: 'Org Code', Type: 'String' }, + TaskingManagerOrgDomain: { + Description: 'FQDN for Organisation used as suffix for DNS entries', + Type: 'String', + Default: 'hotosm.org' + }, SentryBackendDSN: { Description: "DSN for sentry", Type: 'String' @@ -560,13 +566,42 @@ const Resources = { Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer', Properties: { Name: cf.stackName, + IpAddressType: 'dualstack', + LoadBalancerAttributes: [ + { "Key": "routing.http2.enabled", "Value": "true" }, + { "Key": "idle_timeout.timeout_seconds", "Value": "180" }, + ], SecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'elbs-security-group', cf.region]))], Subnets: cf.ref('ELBSubnets'), Type: 'application', - IpAddressType: 'dualstack', Tags: [ { "Key": "stack_name", "Value": cf.stackName } ] } }, + BackendAPIDNSEntries: { + Type: "AWS::Route53::RecordSetGroup", + Properties: { + Comment: "DNS records pointing to API backend", + HostedZoneId: 'Z05223682CWA7KUW593DH', // NOTE: tasks.hotosm.org HostedZone ID on Route53 + RecordSets: [ + { + Name: cf.join('.', [ cf.join('-', ['api', cf.ref('NetworkEnvironment')]), 'tasks.hotosm.org']), + Type: 'A', + AliasTarget: { + DNSName: cf.getAtt('TaskingManagerLoadBalancer', 'DNSName'), + HostedZoneId: cf.getAtt('TaskingManagerLoadBalancer', 'CanonicalHostedZoneID') // NOTE: AWS Route53 Canonical HostedZone ID + } + }, + { + Name: cf.join('.', [ cf.join('-', ['api', cf.ref('NetworkEnvironment')]), 'tasks.hotosm.org']), + Type: 'AAAA', + AliasTarget: { + DNSName: cf.getAtt('TaskingManagerLoadBalancer', 'DNSName'), + HostedZoneId: cf.getAtt('TaskingManagerLoadBalancer', 'CanonicalHostedZoneID') // NOTE: AWS Route53 Canonical HostedZone ID + }, + } + ] + } + }, TaskingManagerLoadBalancerRoute53: { Type: 'AWS::Route53::RecordSet', Properties: { @@ -755,19 +790,6 @@ const Resources = { } } }, - TaskingManagerRoute53: { - Type: 'AWS::Route53::RecordSet', - Condition: 'IsHOTOSMUrl', - Properties: { - Name: 't0.hotosm.org', - Type: 'A', - AliasTarget: { - DNSName: cf.getAtt('TaskingManagerReactCloudfront', 'DomainName'), - HostedZoneId: 'Z2FDTNDATAQYW2' - }, - HostedZoneId: 'Z2O929GW6VWG99', - } - }, TaskingManagerDNSEntries: { Type: "AWS::Route53::RecordSetGroup", Condition: "IsHOTOSMUrl",