您还添加了一个S3端点吗?
这是我的模板的一个工作片段,我可以通过aws支持解决该问题:
EcrDkrEndpoint:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
PrivateDnsEnabled: true
SecurityGroupIds: [!Ref 'FargateContainerSecurityGroup']
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ecr.dkr'
SubnetIds: [!Ref 'PrivateSubnetOne',!Ref 'PrivateSubnetTwo']
VpcEndpointType: Interface
VpcId: !Ref 'VPC'
对于S3,您需要知道路由表是必要的-通常,您希望使用与Internet网关相同的路由表,其中包含路由0.0.0.0/0
S3Endpoint:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.s3'
VpcEndpointType: Gateway
VpcId: !Ref 'VPC'
RouteTableIds: [!Ref 'PrivateRouteTable']
没有用于cloudwatch的端点,您还会遇到另一个故障,这也是有必要的:
CloudWatchEndpoint:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
PrivateDnsEnabled: true
SecurityGroupIds: [!Ref 'FargateContainerSecurityGroup']
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.logs'
SubnetIds: [!Ref 'PrivateSubnetOne',!Ref 'PrivateSubnetTwo']
VpcEndpointType: Interface
VpcId: !Ref 'VPC'
编辑:专用路由表:
PrivateRoute:
Type: AWS::EC2::Route
DependsOn: InternetGatewayAttachement
Properties:
RouteTableId: !Ref 'PublicRouteTable'
DestinationCidrBlock: '0.0.0.0/0'
GatewayId: !Ref 'InternetGateway'
,
我发现我不仅需要s3的vpc终结点,aws日志和@graphik_的答案中详细说明的两个ecr终结点,而且我还需要确保终结点上的安全组允许从安全性入口访问HTTPS组在Farscape容器上。
Farscape容器上的安全组需要通过HTTPS到vpce端点安全组以及s3的pl-7ba54012 IP组进行出口访问。
这和到路由表中的pl-7ba54012的路由似乎是整体图。
vpce上也有策略,我将其保留为默认的“所有访问”,但您可以对其进行强化,以仅允许运行Fargate容器的角色进行访问。
本文链接:https://www.f2er.com/3168631.html