Zachary Shilton 830140157d
website: remove obselete nav data (#10811)
* website: remove obselete sidebar_title frontmatter from docs

* website: bump to latest docs-page

* website: update plugin creation and registration docs

* website: fix broken links
2021-03-31 15:07:00 -04:00

53 lines
1.3 KiB
Plaintext

---
description: |
The top-level source block defines reusable builder configuration blocks
page_title: source - Blocks
---
# The `source` block
`@include 'from-1.5/beta-hcl2-note.mdx'`
The top-level `source` block defines reusable builder configuration blocks:
`@include 'from-1.5/sources/example-block.mdx'`
You can start builders by refering to those source blocks form a [`build`
block](/docs/templates/hcl_templates/blocks/build), for example :
```hcl
build {
sources = [
# Here Packer will use a default ami_name when saving the image.
"source.amazon-ebs.example",
"source.amazon-ebs.foo",
]
}
```
The build-level [`source` block](/docs/templates/hcl_templates/blocks/build/source) allows to
set specific source fields.
```hcl
build {
source "source.amazon-ebs.example" {
# Here Packer will use the provided ami_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"
}
}
```
`@include 'from-1.5/contextual-source-variables.mdx'`
## Related
- The list of available builders can be found in the [builders](/docs/builders)
section.
- A list of [community
builders](/community-tools#community-builders) is available.
- Create your own [custom builder](/docs/extending/custom-builders) !