mercredi 29 juillet 2015

Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type : [AWS Cloudformation]

I am trying to create a an t2.micro ec2 instance with amazon linux as os using cloudformation . Following is the json file (parts that matter).

    "FileName" :{
        "Type" : "String",
        "Default" : "cf-file.sh",
        "AllowedValues": [ "cf-file.sh"]
    },
    "InstanceType" : {
      "Description" : "WebServer EC2 instance type",
      "Type" : "String",
      "Default" : "t2.micro",
      "AllowedValues" : ["t2.micro"],
      "ConstraintDescription" : "must be a valid EC2 instance type."
    },

       "AMIID" :{
         "Type": "String",
        "Default":"ami-1ecae776",
        "AllowedValues":["ami-1ecae776"]
    }
  },
  "Resources" : {
    "EC2Instance" : {
      "Type" : "AWS::EC2::Instance",
      "Properties" : {
        "UserData" : {
                "Fn::Base64" : {
                    "Fn::Join" : [ 
                            "", 
                            [
                                "#!/bin/bash\n",
                                "yes y | yum install dos2unix\n",
                                "touch ",{ "Ref" : "FileName" },"\n",
                                "chmod 777 ",{ "Ref" : "FileName" },"\n" 
                            ]
                    ]
                 } 
        },
          "KeyName" : { "Ref" : "KeyName" },
        "ImageId" : { "Ref" : "AMIID" }
      }
    },

When i run this file i get following error

Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type

I guess this error comes when we use t1 family instance type but i am using t2.micro. Please explain the reason why is it so ?




Aucun commentaire:

Enregistrer un commentaire