An error occurred (ValidationError) when calling the CreateStack operation:
Template format error: Unresolved resource dependencies [subnet-057ba3df40f87da4e]
in the Resources block of the template
知道这是我用来创建此堆栈的文件:
Resources:
accessSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "new EC2 security group for HTTP and SHH ports"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: 0.0.0.0/0
SecurityGroupEgress:
- IpProtocol: -1
FromPort: -1
ToPort: -1
CidrIp: 0.0.0.0/0
VpcId: "vpc-09495a820716bff3b"
EC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: "ami-0022f774911c1d690"
InstanceType: t3.micro
NetworkInterfaces:
- AssociatePublicIpAddress: "true"
DeviceIndex: "0"
GroupSet:
- Ref: "accessSecurityGroup"
SubnetId:
Ref: "subnet-057ba3df40f87da4e"
UserData:
Fn::Base64:
!Sub |
#!/bin/bash
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
SecurityGroupIds:
- !Ref accessSecurityGroup
VpcId
存在,我不确定问题是什么。
SubnetId
refThe intrinsic function
returns the value of the specified parameter or resource.
由于它不是指参数或资源,并且该值是硬编码