在CF模板中定义ALB和所需的安全组的正确方法

0

【以下的问题经过翻译处理】 我正在尝试了解如何在 CF 模板中定义 ALB、其侦听器、目标组和安全组。所以我写出了这个代码清单。如果 ALB 是内部的,在端口 443 上侦听流量并将该流量发送到实例 Web 服务器上的端口 80,这是否正确?

ALB

Properties:

    Type: internal

    Listener: 80

    Listener: 443

    Subnets

    SecurityGroups

    LBAttributes

ALBListener80

Properties:

    Reference: ALB

    Port: 80

    Redirect rule to port 443

ALBListener443

Properties:

    Reference: ALB

    Port: 443

    SSL Policy

    Certificate

    Forward rule to ALBTarget80

ALBTarget80

Properties:

    Port: 80

    VPCid

    TargetgroupAttributes

    Registered instance(s)

    Healthcheck

    Check port 80

ALBSecurityGroup

Ingress rules:

    Allow port 80 from VPC CIDR

    Allow port 443 from VPC CIDR

Egress rules:

    Allow port 80 to InstanceSecurityGroup

    Allow port 443 to InstanceSecurityGroup

    Allow All traffic to 127.0.0.1/32

InstanceSecurityGroup

Ingress rules:

    Allow port 80 from VPC CIDR

    Allow port 443 from VPC ALBSecurityGroup

Egress rules:

    Allow all to 0.0.0.0/0

这样看起来对吗?

profile picture
EXPERTE
gefragt vor 5 Monaten14 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 嗨,这大致是正确的。

您的ALBSecurityGroup只需在端口80上进行出站流量,以便向InstanceSecurityGroup发送数据。

您的InstanceSecurityGroup只需从ALBSecurityGroup上的端口80进行入站流量接收。

您的InstanceSecurityGroup不需要任何出站规则来实现此目的,但可能需要一些规则来支持其他功能。

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen