【发布时间】:2021-08-25 19:17:55
【问题描述】:
问题:
使用云形成模板创建安全组时,即使我提供了 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```
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-cloudformation amazon-vpc