Skip to content

Commit

Permalink
Merge pull request #6149 from hotosm/fix/loadbalancer-timeout
Browse files Browse the repository at this point in the history
Increase API load balancer timeout
  • Loading branch information
eternaltyro committed Dec 1, 2023
2 parents c2558e1 + 109b077 commit a1ccfab
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 a1ccfab

Please sign in to comment.