gpt4 book ai didi

amazon-web-services - 云形成无法创建带有 VPCIdNotSpecified 的安全组

转载 作者:行者123 更新时间:2023-12-03 07:17:54 24 4
gpt4 key购买 nike

问题:

使用云形成模板创建安全组时,即使我提供了 VPCID 作为输入,它也会失败并出现 VPCIdNotSpecified 错误。

错误消息:该用户没有默认 VPC(服务:AmazonEC2;状态代码:400;错误代码:VPCIdNotSpecified;请求 ID:d45efd39-16ce-4c0c-9e30-746b39f4ff44;代理:null)

背景:我已经删除了账户自带的默认VPC,创建了自己的VPC。此外,我还获取 VPC ID 作为参数输入。\1/使用 aws cli 来验证模板及其良好性。所有输入参数均已正确获取并显示在云形成创建的摘要页面中。它甚至显示匹配的 VPCID。

代码:

Parameters:
VPCName:
Description: Enter the VPC that you want to launch the instance
Type : AWS::EC2::VPC::Id
ConstraintDescription: VPC must be already existing
Resources:
HANASG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: XSASG
GroupDescription: This will allow connections between your RDP instance & HANA Box
**VpcId: !Ref VPCName**
SecurityGroupIngress:
- IpProtocol: tcp
SourceSecurityGroupName: !Ref RdpSgName
FromPort: 0
ToPort: 65535
SecurityGroupEgress:
- IpProtocol: tcp
FromPort: 0
ToPort: 65535
CidrIp: 0.0.0.0/0
Tags:
- Key: Name
Value: HANAXSASG```

最佳答案

我建议re-creating the default VPC按照亚马逊说明,在控制台的 VPC 部分中。最好不要使用默认 VPC,而是按照您的描述创建和配置您自己的 VPC。在内部,默认 VPC 有一些特殊之处,不通过控制台或 API 公开。我怀疑这是问题的根本原因,创建新的默认 VPC 应该可以解决该问题。

据我所知,重命名默认 VPC 没有问题(我的名称为默认 VPC - 请勿使用)。

关于amazon-web-services - 云形成无法创建带有 VPCIdNotSpecified 的安全组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67893072/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com