diff --git a/website/content/docs/templates/hcl_templates/blocks/source.mdx b/website/content/docs/templates/hcl_templates/blocks/source.mdx index 999087969..24290a317 100644 --- a/website/content/docs/templates/hcl_templates/blocks/source.mdx +++ b/website/content/docs/templates/hcl_templates/blocks/source.mdx @@ -12,29 +12,38 @@ The top-level `source` block defines reusable builder configuration blocks: `@include 'from-1.5/sources/example-block.mdx'` +The first label — `happycloud` here — is the builder type. The second label is +the unique name or identifier you want to give to the source. There can be only one +`source.happycloud.foo` top-level source block; but it can be used more than +once. Builders are usually found in plugins, except for the `file` and the +`null` builders that will remain in Packer core. + You can start builders by refering to those source blocks from a [`build` -block](/docs/templates/hcl_templates/blocks/build), for example : +block](/docs/templates/hcl_templates/blocks/build) : ```hcl build { sources = [ # Here Packer will use a default ami_name when saving the image. - "source.amazon-ebs.example", - "source.amazon-ebs.foo", + "source.happycloud.example", + "source.happycloud.foo", ] } ``` -The build-level [`source` block](/docs/templates/hcl_templates/blocks/build/source) allows to -set specific source fields. +The build-level [`source` +block](/docs/templates/hcl_templates/blocks/build/source) allows to set specific +source fields. Each field must be defined only once and it is currently not +allowed to override a value. ```hcl build { - source "source.amazon-ebs.example" { - # Here Packer will use the provided ami_name instead of defaulting it. + source "source.happycloud.example" { + # Here Packer will use the provided image_name instead of defaulting it. # Note that fields cannot be overwritten, in other words, you cannot - # set the 'ami_name' field in the top-level source block. - ami_name = "specific" + # set the 'image_name' field in the top-level source block and here at the + # same time + image_name = "build_specific_field" } } ``` diff --git a/website/content/partials/from-1.5/sources/example-block.mdx b/website/content/partials/from-1.5/sources/example-block.mdx index d4d2797b9..652371c3c 100644 --- a/website/content/partials/from-1.5/sources/example-block.mdx +++ b/website/content/partials/from-1.5/sources/example-block.mdx @@ -1,6 +1,6 @@ ```hcl # sources.pkr.hcl -source "amazon-ebs" "example-1" { +source "happycloud" "foo" { // ... } ```