无法使用提供的打包程序模板构建 AMI,返回 S3 相关错误

Unable to build AMI's with provided packer templates, returning an S3 related error

我正在按照本指南进行操作,该指南提供了用于创建 AMI 的打包程序模板 https://github.com/scarolan/vault-aws-cf

问题是我是打包机新手,看到以下错误:

Build 'amazon-ebs' errored after 5 seconds 898 milliseconds: Couldn't find specified instance profile: NoSuchEntity: Instance Profile Packer-S3-Access cannot be found.
    status code: 404, request id: 8c62db59-fdaa-4150-bd43-883415839ce6

==> Wait completed after 5 seconds 898 milliseconds

==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Couldn't find specified instance profile: NoSuchEntity: Instance Profile Packer-S3-Access cannot be found.

我正在尝试使用以下方法构建 vault.json:

packer build \ -var 'aws_access_key=<enter-key-here>' \ -var 'aws_secret_key=<enter-key-here>' \ vault.json

我是否在打包程序构建中遗漏了几个参数,或者我是否需要使用相关 AWS 信息编辑打包程序模板文件?

来自加壳器中的 vault.json i can see that Packer-S3-Access is a user defined input which is then used as the iam_instance_profile

{
  "description": "Vault and Consul Client Configuration for Vault.",
  "variables": {
    // snip
    "inst_profile": "Packer-S3-Access",
  },
  "builders": [
    {
      // snip
      "iam_instance_profile": "{{user `inst_profile`}}",

由于是用户输入,您尚未在您的 AWS 账户中使用该名称定义实例配置文件。