Amazon web services Cloudformation中的VPC终结点-终结点类型(网关)与可用服务类型([接口])不匹配
我正在尝试在Cloudformation中为API网关创建VPC端点,但出现以下错误:Amazon web services Cloudformation中的VPC终结点-终结点类型(网关)与可用服务类型([接口])不匹配,amazon-web-services,amazon-cloudformation,aws-api-gateway,Amazon Web Services,Amazon Cloudformation,Aws Api Gateway,我正在尝试在Cloudformation中为API网关创建VPC端点,但出现以下错误: Endpoint type (Gateway) does not match available service types ([Interface]). 下面的模板位于参考资料部分中: executeApiEndpoint: Type: AWS::EC2::VPCEndpoint Properties: PolicyDocument: Version: '2
Endpoint type (Gateway) does not match available service types ([Interface]).
下面的模板位于参考资料部分中:
executeApiEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: "*"
Action:
- "execute-api:Invoke"
- "execute-api:ManageConnections"
Resource:
- "arn:aws:execute-api:*:*:*"
RouteTableIds:
- !Ref privateRouteTable
ServiceName: !Sub com.amazonaws.${AWS::Region}.execute-api
VpcId: !Ref pubPrivateVPC
这个也不行:
executeApiEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: "*"
Action:
- "execute-api:*"
Resource:
- "*"
RouteTableIds:
- !Ref privateRouteTable
ServiceName: !Sub com.amazonaws.${AWS::Region}.execute-api
VpcId: !Ref pubPrivateVPC
但是,此块来自一个能够在没有任何错误的情况下执行的模板:
s3Endpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal: "*"
Action:
- "s3:*"
Resource:
- "*"
RouteTableIds:
- !Ref privateRouteTable
ServiceName: !Sub com.amazonaws.${AWS::Region}.s3
VpcId: !Ref pubPrivateVPC
这里出了什么问题?您还必须将AWS::EC2::VPCEndpoint资源上的指定为接口类型的VPC端点的工作接口。默认值为Gateway,它仅适用于S3和DynamoDB VPC端点
解决方案使用S3作为端点的原因是,VpcEndpointType属性将网关作为适用于S3的默认值。您还必须在AWS::EC2::VPCEndpoint资源上指定作为接口类型的VPC端点工作的接口。默认值为Gateway,它仅适用于S3和DynamoDB VPC端点
解决方案使用S3作为端点的原因是,VpcEndpointType属性将网关作为适用于S3的默认值。我明白了。谢谢你指出这一点!我懂了。谢谢你指出这一点!