此错误的原因是在VPC中创建HTTPS端点所必需的资源未创建。可以将以下代码示例添加到AWS CloudFormation模板中,以确保所有必要的资源都被创建。
Resources:
VpcEndpointSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Security group for VPC endpoint
VpcId:
Ref: VpcId
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 443
ToPort: 443
SourceSecurityGroupId:
Fn::ImportValue: SharedResourcesSecurityGroupId
S3VpcEndpoint:
Type: AWS::EC2::VPCEndpoint
Properties:
ServiceName:
Fn::Sub: com.amazonaws.${AWS::Region}.s3
VpcEndpointType: Gateway
VpcId:
Ref: VpcId
RouteTableIds:
-
Ref: RouteTableIdPrivate
SecurityGroupIds:
-
Ref: VpcEndpointSecurityGroup
该代码确保了必要的资源(VPC端点安全组和S3 VPC端点)在VPC中创建。这样,在Event Bridge中创建API目的地时,将允许HTTPS端点创建。
需要替换示例代码中的VPC ID和路由表ID以匹配您的VPC配置。