more examples for the source block

This commit is contained in:
Adrien Delorme 2020-06-02 12:11:55 +02:00
parent 9a22e85e91
commit 935ac55d24
1 changed files with 24 additions and 2 deletions

View File

@ -14,8 +14,30 @@ The top-level `source` block defines reusable builder configuration blocks:
`@include 'from-1.5/sources/example-block.mdx'` `@include 'from-1.5/sources/example-block.mdx'`
Build-level [`source` blocks](/docs/from-1.5/blocks/build/source) allows you to You can start builders by refering to those source blocks form a [`build`
specifically set source fields at the moment of using them. block](/docs/from-1.5/blocks/build), for example :
```hcl
build {
source = [
# Here Packer will use a default ami_name when saving the image.
"sources.amazon-ebs.example",
"sources.amazon-ebs.foo",
]
}
```
The build-level [`source` block](/docs/from-1.5/blocks/build/source) allows to
set specific source fields.
```hcl
build {
source "sources.amazon-ebs.example" {
# Here Packer will use the provided ami_name instead of defaulting it.
ami_name = "specific"
}
}
```
## Related ## Related