Skip to content

Commit

Permalink
Increase API load balancer timeout
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
eternaltyro authored and dakotabenjamin committed Dec 12, 2023
1 parent cf3f38d commit 716b25c
Showing 1 changed file with 38 additions and 16 deletions.
54 changes: 38 additions & 16 deletions scripts/aws/cloudformation/tasking-manager.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 716b25c

Please sign in to comment.