amazon-web-services - Cloud Formation 无法使用 VPCIdNotSpecified 创建安全组
问题描述
问题 :
使用云形成模板创建安全组时,即使我提供了 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```
解决方案
我建议按照亚马逊的说明在控制台的 VPC 部分重新创建默认 VPC 。最好不要使用默认 VPC,而是按照您的描述创建和配置您自己的 VPC。在内部,默认 VPC 有一些特殊之处,未通过控制台或 API 公开。我怀疑这是您问题的根本原因,创建一个新的默认 VPC 应该可以解决它。
AFAIK 重命名默认 VPC 没有问题(我的名为Default VPC - DO NOT USE
)。
推荐阅读
- javascript - 如何从特定跨度类中搜索和删除特定锚标记
- swift - 无法转换“范围”类型的值
' 到预期的参数类型 'Range<_>' - c - 如何按顺序修改数组中的值
- c++ - 如果基方法不是虚拟的,则调用重写的方法
- postgresql - 如何在 OpenShift 中运行 pgAdmin?
- c++ - 我的双精度数四舍五入,我不希望它
- azure - Serilog:在 azure 中托管时,azure webjob 日志记录似乎不起作用?
- c# - 选项卡控件(动态创建)中的 C# WPF Datagrid 不显示数据
- treeview - Odoo 树视图仅显示一条计算记录
- php - 在 Woocommerce 中对超过 1000 美元的澳大利亚订单实行零税