我正在尝试创建一个堆栈,以使用带有关键输入参数的cloudformation部署ec2instance,但是它抛出验证错误
我尝试了所有组合方式。请帮我哪里错了
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "Ec2 block device mapping"
Parameters:
KeyName:
Description: "Name of an existing EC2 KeyPair to enable SSH access into
the WordPress web server"
Type: "AWS::EC2::KeyPair::KeyName"
KeyNameInput:
AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*"
Default: kinesis-key
Description: "Enter the keyname"
MaxLength: 41
MinLength: 1
Type: String
Resources:
InstanceSecurityGroup:
Properties:
GroupDescription: "Enable SSH access via port 22"
SecurityGroupIngress:
-
CidrIp: 0.0.0.0/0
FromPort: "22"
IpProtocol: tcp
ToPort: "22"
Type: "AWS::EC2::SecurityGroup"
MyEC2Instance:
Properties:
AvailabilityZone: us-east-1a
BlockDeviceMappings:
-
DeviceName: /dev/sdm
Ebs:
DeleteOnTermination: "false"
Iops: "200"
VolumeSize: "20"
VolumeType: io1
-
DeviceName: /dev/sdk
NoDevice: {}
ImageId: ami-0080e4c5bc078760e
InstanceType: t2.micro
KeyName: KeyName
SecurityGroupIds:
- InstanceSecurityGroup
Type: "AWS::EC2::Instance"