farwardtotargetgroup:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
Certificates:
- CertificateArn: !Ref cert
DefaultActions:
- TargetGroupArn: !Ref target-group
Type: forward
LoadBalancerArn: !Ref nlb
Port: 443
Protocol: TLS
redirectto443:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- RedirectConfig:
Port: 443
StatusCode: HTTP_301
Type: redirect
LoadBalancerArn: !Ref nlb
Port: 80
Protocol: TLS
Run Code Online (Sandbox Code Playgroud)
当我执行模板时,我得到:
操作类型“重定向”对于网络负载均衡器无效(服务:AmazonElasticLoadBalancingV2;状态代码:400;错误代码:InvalidLoadBalancerAction;
无法在 Cloudformation 中进行以下工作。
Conditions:
EmptyBalancer:
!Equals [!Ref BalancerName, '']
EmptyAutoscaling:
!Equals [!Ref AutoscalingName, '']
NoLoadBalancerAndAutoscaling:
!And [EmptyBalancer, EmptyAutoscaling]
Run Code Online (Sandbox Code Playgroud)
条件不编译。结果出现模板错误:
每个 Fn::And 对象需要一个至少 2 个、最多 10 个布尔参数的列表
还尝试了其他但相同的错误
NoLoadBalancerAndAutoscaling:
!And [!Ref EmptyBalancer, !Ref EmptyAutoscaling]
Run Code Online (Sandbox Code Playgroud)
请帮忙!