

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# `AWS-CreateImage`
<a name="automation-aws-createimage"></a>

**描述**

co从 Amazon Elastic Compute Cloud (Amazon EC2) 实例创建新 Amazon Machine Image (AMI)。

[运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-CreateImage)

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（可选）允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
+ InstanceId

  类型：字符串

  说明：（必需）EC2 实例的 ID。
+ NoReboot

  类型：布尔值

  说明：（可选）创建映像前，不要重启实例。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:CreateImage",
                "ec2:DescribeImages"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
```

------