模板验证错误:参数“ KeyNameInput”必须与模式[a-zA-Z] [a-zA-Z0-9] *相匹配

时间:2019-04-13 05:27:10

标签: validation templates stack

我正在尝试创建一个堆栈,以使用带有关键输入参数的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"

0 个答案:

没有答案