{"id":16111824,"url":"https://github.com/cliffano/packer-post-processor-json-updater","last_synced_at":"2025-07-21T10:33:04.089Z","repository":{"id":27660763,"uuid":"31146437","full_name":"cliffano/packer-post-processor-json-updater","owner":"cliffano","description":"Packer Post-Processor plugin for updating JSON files","archived":false,"fork":false,"pushed_at":"2021-08-15T08:03:19.000Z","size":142,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-04T05:33:22.360Z","etag":null,"topics":["json","packer","post-processor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cliffano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-22T00:07:38.000Z","updated_at":"2024-09-15T20:24:35.000Z","dependencies_parsed_at":"2022-09-03T00:44:19.057Z","dependency_job_id":null,"html_url":"https://github.com/cliffano/packer-post-processor-json-updater","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cliffano/packer-post-processor-json-updater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cliffano%2Fpacker-post-processor-json-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cliffano%2Fpacker-post-processor-json-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cliffano%2Fpacker-post-processor-json-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cliffano%2Fpacker-post-processor-json-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cliffano","download_url":"https://codeload.github.com/cliffano/packer-post-processor-json-updater/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cliffano%2Fpacker-post-processor-json-updater/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266285495,"owners_count":23905363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","packer","post-processor"],"created_at":"2024-10-09T19:45:36.890Z","updated_at":"2025-07-21T10:33:04.071Z","avatar_url":"https://github.com/cliffano.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"https://raw.github.com/cliffano/packer-post-processor-json-updater/master/avatar.jpg\" alt=\"Avatar\"/\u003e\n\n[![Build Status](https://github.com/cliffano/packer-post-processor-json-updater/workflows/CI/badge.svg)](https://github.com/cliffano/packer-post-processor-json-updater/actions?query=workflow%3ACI)\n\nPacker Post-Processor JSON Updater\n----------------------------------\n\nA Packer Post-Processor plugin for updating JSON files.\n\nThis is handy when you want to update one or more JSON files after Packer already finish executing the builders.\n\nAn example scenario is when you have several Packer templates where the built image of a template becomes the source of a number of other templates.\n\nInstallation\n------------\n\nDownload the plugin binaries from [Releases page](https://github.com/cliffano/packer-post-processor-json-updater/releases), or build from source using `make build` or other Go build tools of your choice. Then follow [Packer plugins installation guide](https://www.packer.io/docs/extend/plugins.html).\n\nIf you downloaded one of the pre-built binaries, make sure that you rename the binary file to `packer-post-processor-json-updater` (i.e. remove the _os_arch postfix).\n\nUsage\n-----\n\nAdd `json-updater` type to Packer template's post-processor section:\n\n    \"post-processors\": [\n        {\n            \"type\": \"json-updater\",\n            \"ami_id\": {\n                \"templates/child_template_1.json\": [\n                    \"variables.aws_source_ami\"\n                ],\n                \"templates/child_template_2.json\": [\n                    \"variables.aws_source_ami\"\n                ]\n            }\n        }\n    ]\n\nThe above `ami_id` configuration indicates that the ID of the newly created AWS AMI will be set as the value of `variables.aws_source_ami` key in `templates/child_template_1.json` and `templates/child_template_2.json` files.\n\n    \"variables\": {\n        \"aws_source_ami\": \"\u003cami_id\u003e\"\n    }\n\nVariable interpolation is also supported:\n\n    \"variables\": {\n        \"build_id\": \"build_123\"\n    },\n    \"post-processors\": [\n        {\n            \"type\": \"json-updater\",\n            \"ami_id\": {\n                \"templates/child_template_3.json\": [\n                    \"variables.aws_source_ami_{{user `build_id` }}\"\n                ],\n            }\n        }\n    ]\n\nThe above `ami_id` configuration indicates that the ID of the newly created AWS AMI will be set as the value of `variables.aws_source_ami_build_123` key in `templates/child_template_3.json` file.\n\n    \"variables\": {\n        \"aws_source_ami_build_123\": \"\u003cami_id\u003e\"\n    }\n\nTesting\n-------\n\nRun unit test:\n\n    make test\n\nRun integration test:\n\n    AWS_PROFILE=\u003cprofile_name\u003e make test-integration\n\nThis will create an AMI with `project` tag having value `packer-post-processor-json-updater`.\n\nColophon\n--------\n\nArticles:\n\n* [Custom AWS AMIs Dependency Tree](http://blog.cliffano.com/2016/03/19/custom-aws-amis-dependency-tree/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcliffano%2Fpacker-post-processor-json-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcliffano%2Fpacker-post-processor-json-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcliffano%2Fpacker-post-processor-json-updater/lists"}