在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
전문가
질문됨 5달 전14회 조회
1개 답변
0

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

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

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

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

profile picture
전문가
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠