Я пытаюсь добавить несколько правил прослушивателя, которые перенаправляют трафик с RedirectionDomain на RedirectionTargetDomain, но после запуска шаблона CF некоторые правила пропускаются.
Я пытался изменить имена и приоритеты, но меняются только элементыисчезает
Параметры:
RedirectionTargetDomain - цель перенаправления
RedirectionDomain - домен для перенаправления
Условия:
CreateAdditionalHttpRedirectRule - проверяет, является лиПредоставляются 2 параметра
PrimeGroupELBHttpListenerRuleNonWww:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: CreateAdditionalHttpRedirectRule
Properties:
Actions:
-
Type: redirect
RedirectConfig:
Host: !Ref RedirectionTargetDomain
Path: "/#{path}"
Port: 443
Protocol: HTTPS
StatusCode: HTTP_301
Conditions:
-
Field: host-header
Values:
- !Ref RedirectionDomain
ListenerArn: !Ref PrimeGroupELBHttpListener
Priority: 1000
PrimeGroupELBHttpListenerRuleWww:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: CreateAdditionalHttpRedirectRule
Properties:
Actions:
-
Type: redirect
RedirectConfig:
Host: !Join [ '', [ 'www.', !Ref RedirectionTargetDomain ] ]
Path: "/#{path}"
Port: 443
Protocol: HTTPS
StatusCode: HTTP_301
Conditions:
-
Field: host-header
Values:
- !Join [ '', [ 'www.', !Ref RedirectionDomain ] ]
ListenerArn: !Ref PrimeGroupELBHttpListener
Priority: 900
PrimeGroupELBHttpListenerRuleWildcards:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: CreateAdditionalHttpRedirectRule
Properties:
Actions:
-
Type: redirect
RedirectConfig:
Host: !Ref RedirectionTargetDomain
Path: "/#{path}"
Port: 443
Protocol: HTTPS
StatusCode: HTTP_301
Conditions:
-
Field: host-header
Values:
- !Join [ '', [ '*.', !Ref RedirectionDomain ] ]
ListenerArn: !Ref PrimeGroupELBHttpListener
Priority: 950
PrimeGroupELBHttpListenerRuleTesting:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: CreateAdditionalHttpRedirectRule
Properties:
Actions:
-
Type: redirect
RedirectConfig:
Host: !Join [ '', [ 'testing.', !Ref RedirectionTargetDomain ] ]
Path: "/#{path}"
Port: 443
Protocol: HTTPS
StatusCode: HTTP_301
Conditions:
-
Field: host-header
Values:
- !Join [ '', [ 'testing.', !Ref RedirectionDomain ] ]
ListenerArn: !Ref PrimeGroupELBHttpListener
Priority: 800
PrimeGroupELBHttpListenerRuleTestingApi:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Condition: CreateAdditionalHttpRedirectRule
Properties:
Actions:
-
Type: redirect
RedirectConfig:
Host: !Join [ '', [ 'testing-api.', !Ref RedirectionTargetDomain ] ]
Path: "/#{path}"
Port: 443
Protocol: HTTPS
StatusCode: HTTP_301
Conditions:
-
Field: host-header
Values:
- !Join [ '', [ 'testing-api.', !Ref RedirectionDomain ] ]
ListenerArn: !Ref PrimeGroupELBHttpListener
Priority: 700
Я ожидаю, что после запуска сборки будет добавлено 5 правил.Но это приводит только к 3 правилам.