使用 AWS CLI 导入 VM 映像

Import the VM image using the AWS CLI

我正在尝试使用 AWS CLI 从我的 s3 存储桶导入我的 OVA 图像。我有

aws ec2 import-image --disk-containers Format=ova,UserBucket="{S3Bucket=arn:aws:s3:::my-vm-rony,"S3Key=windows_7.ova}"

我收到以下消息:

"An error occurred (InvalidParameter) when calling the ImportImage operation: User does not have access to the S3 object"

我的 AWS 用户拥有以下权限: AmazonS3FullAccess, AdministratorAccess、AWSImportExportFullAccess、VMImportExportRoleForAWSConnector、AWSImportExportReadOnlyAccess、vmimport

我添加到我的存储桶策略

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1476979061000",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::109816374014:user/RonyLevi"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::my-vm-rony",
                "arn:aws:s3:::my-vm-rony/*"
            ]
        }
    ]
}

应该是存储桶名称,而不是 ARN:

aws ec2 import-image --disk-containers Format=ova,UserBucket="{S3Bucket=my-vm-rony,S3Key=windows_7.ova}"