Enable EC2 on your Amazon Account

This article provides step-by-step instructions on how to configure Amazon VMimport Role to import virtual machine images from your existing environment to Amazon EC2 instances.

Do the following to configure a VMImport role.

Log in ****to Amazon Web Services using your Amazon account and switch to *Identity & Access Management.*

Select Roles on the AWS menu and click Create New Role.

Enter "vmimport" ****in the *Role Name* field and click Next Step.

Click Select next to the Amazon EC2 role.

Click Next Step to skip this page.

Review your role information and click Create Role.

Select your new role.

Expand the Inline Policies category and click a link to create a new policy.

Specify the policy name in the policy document text field and insert the following policy script.

{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Effect":"Allow",
         "Action":[
            "s3:ListBucket",
            "s3:GetBucketLocation"
         ],
         "Resource":[
            "arn:aws:s3:::bucket"
         ]
      },
      {
         "Effect":"Allow",
         "Action":[
            "s3:GetObject"
         ],
         "Resource":[
            "arn:aws:s3:::bucket/*"
         ]
      },
      {
         "Effect":"Allow",
         "Action":[
            "ec2:ModifySnapshotAttribute",
            "ec2:CopySnapshot",
            "ec2:RegisterImage",
            "ec2:Describe*"
         ],
         "Resource":"*"
      }
   ]
}

In the policy script, replace the black placeholders in the following image with your bucket's name and click Apply Policy.

Expand the Trust Relationships section and click Edit Trust Relationships.

Insert the following script in the Policy Document text field.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "vmie.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "vmimport"
        }
      }
    }
  ]
}

Click Update Trust Policy to finish configuring your VMimport role.