Skip to content

Commit

Permalink
Merge pull request #718 from PRX/app-domains
Browse files Browse the repository at this point in the history
Update hostnames for Augury and Feeder
  • Loading branch information
farski authored Oct 23, 2023
2 parents a224353 + dce8f82 commit d0316d3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
1 change: 1 addition & 0 deletions spire/templates/apps-300A.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Resources:
CastlePostgresInstanceEndpointPort: !Ref CastlePostgresInstanceEndpointPort
CastlePostgresClientSecurityGroupId: !Ref CastlePostgresClientSecurityGroupId
AdFilesHostname: !Ref AdFilesHostname
AuguryHostname: !Ref AuguryHostname
FeederHostname: !Ref FeederHostname
IdHostname: !Ref IdHostname
CastleHostname: !Ref CastleHostname
Expand Down
15 changes: 11 additions & 4 deletions spire/templates/apps/augury.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Parameters:
CastlePostgresInstanceEndpointPort: { Type: String }
CastlePostgresClientSecurityGroupId: { Type: String }
AdFilesHostname: { Type: String }
AuguryHostname: { Type: String }
FeederHostname: { Type: String }
IdHostname: { Type: String }
CastleHostname: { Type: String }
Expand Down Expand Up @@ -94,18 +95,24 @@ Resources:
- inventory.dovetail.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "01"]]
AltHostHeaderListenerRule:
RedirectHostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
- RedirectConfig:
Host: !Ref AuguryHostname
Path: "/#{path}"
Port: "#{port}"
Protocol: "#{protocol}"
Query: "#{query}"
StatusCode: "HTTP_301"
Type: redirect
Conditions:
- Field: host-header
Values:
- augury.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "02"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "03"]]

TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Expand Down
34 changes: 10 additions & 24 deletions spire/templates/apps/feeder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ Parameters:

Conditions:
IsProduction: !Equals [!Ref EnvironmentType, Production]
IsStaging: !Equals [!Ref EnvironmentType, Staging]
IsPrimaryRegion: !Equals [!Ref RegionMode, Primary]
HasAuroraEndpoint: !Not [!Equals [!Ref SharedAuroraPostgresqlEndpoint, ""]]
EnableWorkers: !And [!Condition HasAuroraEndpoint, !Condition IsPrimaryRegion]
Expand All @@ -82,6 +81,10 @@ Resources:
WebLoggedErrorsMetricName: !Sub WebLoggedErrors${EnvironmentType}
PublicFeedsUrlPrefix: !Sub https://${PublicFeedsHostname}/f

# The canonical address for this app is podcasts.dovetail.prx.org.
# API traffic to the old feeder.prx.org domain should continue to be handled
# directly.
# All other traffic to feeder.prx.org should redirect to the new domain.
HostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Expand All @@ -94,23 +97,8 @@ Resources:
- podcasts.dovetail.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "01"]]
AltHostHeaderListenerRule:
LegacyApiWildcardListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsProduction
Properties:
Actions:
- TargetGroupArn: !Ref WebTargetGroup2
Type: forward
Conditions:
- Field: host-header
Values:
- feeder.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "02"]]

Temp1ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsStaging
Properties:
Actions:
- TargetGroupArn: !Ref WebTargetGroup2
Expand All @@ -123,10 +111,9 @@ Resources:
Values:
- /api/*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "07"]]
Temp3ListenerRule:
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "20"]]
LegacyApiRootListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsStaging
Properties:
Actions:
- TargetGroupArn: !Ref WebTargetGroup2
Expand All @@ -139,10 +126,9 @@ Resources:
Values:
- /api
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "08"]]
Temp2ListenerRule:
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "21"]]
LegacyRedirectListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsStaging
Properties:
Actions:
- RedirectConfig:
Expand All @@ -158,7 +144,7 @@ Resources:
Values:
- feeder.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "11"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "99"]]

DefaultJobQueue:
Type: AWS::SQS::Queue
Expand Down
4 changes: 2 additions & 2 deletions spire/templates/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Mappings:
Production:
EnvironmentTypeAbbreviation: prod
EnvironmentTypeLowercase: production
AuguryHostname: augury.prx.org
AuguryHostname: inventory.dovetail.prx.org
BetaHostname: beta.prx.org
CastleHostname: castle.prx.org
CmsHostname: cms.prx.org
Expand All @@ -57,7 +57,7 @@ Mappings:
ExchangeHostname: exchange.prx.org
ExchangeApiHostname: api.prx.org
ExchangeTransferHostname: prxtransfer.org
FeederHostname: feeder.prx.org
FeederHostname: podcasts.dovetail.prx.org
FeederAssetsHostname: assets.feeder.prx.org
FeederAuthProxyHostname: p.prxu.org
FixerHostname: fixer.prx.org
Expand Down

0 comments on commit d0316d3

Please sign in to comment.