-2

I am using packer to create a base ami and using a post proccessor to create a manifest.json file

how can i make this json valid

{
  "builds": [
    {
      "name": "amazon-ebs",
      "builder_type": "amazon-ebs",
      "build_time": 1589466697,
      "files": null,
      "artifact_id": "eu-west-1:ami-04d3331ac647e751b",
      "packer_run_uuid": "add4c072-7ac2-f5e9-b941-6b80003c03ec",
      "custom_data": {
        "my_custom_data": "example"
      }
    }
  ],
  "last_run_uuid": "add4c072-7ac2-f5e9-b941-6b80003c03ec"
  2020-05-14T14:31:37.246153577Z stdout P }
Error: Parse error on line 13:
...b941-6b80003c03ec"   2020 - 05 - 14 T14: 
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'NUMBER'

My eventual goal is to save the artifact_id to a var using bash

  • 1
    Use something like [JSONLint](https://jsonlint.com/) to easy spot JSON syntax errors. That said, the last line is invalid, it should be quoted with a key, or removed. – 0stone0 May 20 '20 at 10:19

1 Answers1

0

Thank you for the help,

In order to make it valid json, i had to add this attribute to my packer template.json:

 "post-processors": [
        {
            "type": "manifest",
            "output": "manifest.json",
            "strip_path": true,
            "strip_time": true

"strip_time": "true"