0

我正在按照本指南提供打包程序模板来创建 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 信息编辑打包程序模板文件?

4

1 回答 1

1

vault.json我可以看到这Packer-S3-Access是一个用户定义的输入,然后用作打包程序中的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 账户中使用该名称定义实例配置文件。

于 2020-09-09T10:24:51.763 回答