我尝试使用我的AWS账户中的现有值创建EC2实例。 CloudFormation控制台表示模板有效。但是当我尝试创建堆栈时,它失败并出现以下错误:
CREATE_FAILED AWS :: EC2 :: Instance Ec2Instance目前不支持所请求的配置。请查看文档以获取支持的配置。**
有人可以帮我解决这个错误。我的CloudFormation模板如下所示。
三江源。
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation template for creating an ec2 instance
Parameters:
VPC:
Description: 'vpc'
Type: List<AWS::EC2::VPC::Id>
AvailabilityZone:
Description: 'test a-z'
Type: List<AWS::EC2::AvailabilityZone::Name>
KeyName:
Description: Key Pair name
Type: AWS::EC2::KeyPair::KeyName
Default: kskey-1
InstanceType:
Description: 'The instance type for the EC2 instance.'
Type: String
Default: t2.micro
AllowedValues:
- t2.micro
- t2.small
- t2.medium
Name:
Description: 'Then name of the EC2 instance'
Type: String
Default: 'KS-Test'
Subnet:
Description: ' The subnet id'
Type: String
SecurityGroups:
Description: 'The security group'
Type: List<AWS::EC2::SecurityGroup::Id>
Mappings:
RegionMap:
ap-south-1:
AMI: ami-b46f48db
Resources:
Ec2Instance:
Type: 'AWS::EC2::Instance'
Properties:
SecurityGroupIds: !Ref SecurityGroups
KeyName: !Ref KeyName
ImageId: !FindInMap
- RegionMap
- !Ref 'AWS::Region'
- AMI
SubnetId: !Ref Subnet