Plugin nomenclature change?

External third party plugins if I recall are supposed to be named like this
packer-- ?
This was in the transcripts of this talk Extending Packer, has this changed at least on 1.7.0 and above via HCL?

eg: I’m trying to use GitHub - martinbaillie/packer-post-processor-ami-copy: Packer post-processor plugin for copying, encrypting, tagging a built AMI into other accounts. in an HCL2 template such as :

packer {
required_plugins {
packer-post-processor-ami-copy = {
version = “>= 1.0.8”
source = “github.com/martinbaillie/packer-post-processor-ami-copy
}
}
}

But when I run packer init
I see :
`Error: Invalid plugin type

on myawesomebuild.json.pkr.hcl line 49, in packer:
49: packer-post-processor-ami-copy = {
50: version = “>= 1.0.8”
51: source = “github.com/martinbaillie/packer-post-processor-ami-copy
52: }

Plugin source “github.com/martinbaillie/packer-post-processor-ami-copy” has a
type with the prefix “packer-”, which isn’t allowed because it would be
redundant to name a Packer plugin with that prefix. If you are the author of
this plugin, rename it to not include the prefix.`

Same behavior in the example plugin from the same talk,
on anewtempalte.json.pkr.hcl line 51, in packer:
51: packer-provisioner-com = {
52: version = “>= 0.1”
53: source = “github.com/SwampDragons/packer-provisioner-comment
54: }

Plugin source “github.com/swampdragons/packer-provisioner-comment” has a type
with the prefix “packer-”, which isn’t allowed because it would be redundant to
name a Packer plugin with that prefix. If you are the author of this plugin,
rename it to not include the prefix.

I may have missed an announcement/documentation update, just wondering if this has changed indeed

forgive the typo, in my snipped I had the plugin name incorrect as ‘packer-provisioner-com’ - that was a copy/paste error, I’m using the name correctly

Hello!

I think you need to take one step back and go through Upgrading your template to use Packer init | Packer by HashiCorp, if you haven’t already.
This will help you know if the plugin you use is compatible with v1.7.0 API version. There’s is a table that shows what is compatible with what.

To use packer init and required_plugins, the plugin must be a multi-component plugin and compatible with 5.0 API version.

The source field must not contain the packer-plugin- prefix. That means, when the plugin you use is compatible with packer init, its source will be github.com/martinbaillie/ami-copy.

Anyways, I think we can improve the error logs there. Do you mind opening an issue for the logs, so we can keep track of it.

Another great source of information on packer init is the HashiTalk of one of the maintainers. I strongly recommend you to see it!

1 Like

hey thankyou!
thank makes sense, could you be so kind to point me to how to manually install a single-component plugin however?
The documentation here Plugins | Packer | HashiCorp Developer seems to not have that block anymore

Yep! Sorry for the missing documentation there, we fixed it and will deploy it soon.
Until then you can check out the doc in our preview: Plugins | Packer by HashiCorp

Let me know if you need any help or have any questions!

1 Like