Skip to content

Commit

Permalink
Update staging Feeder ALB rules
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Oct 17, 2023
1 parent a15006f commit ec205fe
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions spire/templates/apps/feeder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ 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 Down Expand Up @@ -95,6 +96,7 @@ Resources:
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "01"]]
AltHostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsProduction
Properties:
Actions:
- TargetGroupArn: !Ref WebTargetGroup2
Expand All @@ -106,6 +108,42 @@ Resources:
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "02"]]

Temp1ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsStaging
Properties:
Actions:
- TargetGroupArn: !Ref WebTargetGroup2
Type: forward
Conditions:
- Field: host-header
Values:
- feeder.*
- Field: path-pattern
Values:
- /api/v1/*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "07"]]
Temp2ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: IsStaging
Properties:
Actions:
- RedirectConfig:
Host: !Ref FeederHostname
Path: "/#{path}"
Port: "#{port}"
Protocol: "#{protocol}"
Query: "#{query}"
StatusCode: "HTTP_301"
Type: redirect
Conditions:
- Field: host-header
Values:
- feeder.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "11"]]

DefaultJobQueue:
Type: AWS::SQS::Queue
DeletionPolicy: Delete
Expand Down

0 comments on commit ec205fe

Please sign in to comment.