Packer で iam_instance_profile で利用する場合に、IAMInstanceProfile 関連の操作が必要になるので、
事前に Packer で利用するインスタンス作成のユーザに書きのポリシーを適用しておく必要がある。
でないと下記のように、インスタンス作成エラーが発生します。
==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Error launching source instance: UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message:
厳密には下記の Resource すべては必要ないですが、、。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1453626845000",
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": [
"*"
]
}
]
}