You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/website/pages/docs/from-1.5/blocks/build/source.mdx

31 lines
762 B

---
description: >
A source block nested in a build block allows you to use an already defined
source and to set specific fields.
layout: docs
page_title: source - build - Blocks
sidebar_title: <tt>source</tt>
---
# The `source` block
`@include 'from-1.5/beta-hcl2-note.mdx'`
A `source` block nested in a `build` block allows to use an already defined
source and to set specific fields.
```hcl
# builds.pkr.hcl
build {
source "amazon-ebs.example" {
output = "specific-value"
}
# ...
}
```
-> **Note:** It is **not allowed** to set the same field in a top-level source
block and in a used source block. For example, if in the above example, the
top-level "amazon-ebs.example" source block also had an `output` field;
Packer would error.