Skip to content
Latchkey

Packer "required_plugins" missing from template in CI

packer init only installs plugins that a required_plugins block inside a packer {} stanza names. If the block is missing or omits your builder, init installs nothing and build fails on an unknown type.

What this error means

packer init reports nothing to install, then packer build fails with an unknown builder or "is not installed" because the plugin was never declared.

packer
Error: Unknown builder type: amazon-ebs

  on build.pkr.hcl line 12:
  (source code not available)

known builder types: file, null

Common causes

No required_plugins block for the builder

The template uses amazon-ebs but never declares the amazon plugin in a packer { required_plugins { ... } } stanza, so init has nothing to fetch.

The plugin source or version is wrong

A typo in the source path or an unsatisfiable version constraint means init cannot resolve the plugin you intended.

How to fix it

Declare the plugin in required_plugins

  1. Add a packer {} stanza with a required_plugins block.
  2. Name each plugin with its source and a version constraint.
  3. Run packer init so the declared plugins install.
build.pkr.hcl
packer {
  required_plugins {
    amazon = {
      source  = "github.com/hashicorp/amazon"
      version = ">= 1.2.0"
    }
  }
}

Verify the source path and version

Match the source exactly to the plugin repository and use a constraint that has a published release.

How to prevent it

  • Declare every builder and provisioner plugin in required_plugins.
  • Pin a version constraint that has published releases.
  • Run packer init in CI so the declared plugins are actually fetched.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →