|
|
|
|
@ -114,9 +114,8 @@ builder.
|
|
|
|
|
|
|
|
|
|
- `ami_description` (string) - The description to set for the
|
|
|
|
|
resulting AMI(s). By default this description is empty. This is a
|
|
|
|
|
[template engine](/docs/templates/engine.html)
|
|
|
|
|
where the `SourceAMI` variable is replaced with the source AMI ID and
|
|
|
|
|
`BuildRegion` variable is replaced with the value of `region`.
|
|
|
|
|
[template engine](/docs/templates/engine.html),
|
|
|
|
|
see [Build template data](#build-template-data) for more information.
|
|
|
|
|
|
|
|
|
|
- `ami_groups` (array of strings) - A list of groups that have access to
|
|
|
|
|
launch the resulting AMI(s). By default no groups have permission to launch
|
|
|
|
|
@ -221,16 +220,14 @@ builder.
|
|
|
|
|
- `run_tags` (object of key/value strings) - Tags to apply to the instance
|
|
|
|
|
that is *launched* to create the AMI. These tags are *not* applied to the
|
|
|
|
|
resulting AMI unless they're duplicated in `tags`. This is a
|
|
|
|
|
[template engine](/docs/templates/engine.html)
|
|
|
|
|
where the `SourceAMI` variable is replaced with the source AMI ID and
|
|
|
|
|
`BuildRegion` variable is replaced with the value of `region`.
|
|
|
|
|
[template engine](/docs/templates/engine.html),
|
|
|
|
|
see [Build template data](#build-template-data) for more information.
|
|
|
|
|
|
|
|
|
|
- `run_volume_tags` (object of key/value strings) - Tags to apply to the volumes
|
|
|
|
|
that are *launched* to create the AMI. These tags are *not* applied to the
|
|
|
|
|
resulting AMI unless they're duplicated in `tags`. This is a
|
|
|
|
|
[template engine](/docs/templates/engine.html)
|
|
|
|
|
where the `SourceAMI` variable is replaced with the source AMI ID and
|
|
|
|
|
`BuildRegion` variable is replaced with the value of `region`.
|
|
|
|
|
[template engine](/docs/templates/engine.html),
|
|
|
|
|
see [Build template data](#build-template-data) for more information.
|
|
|
|
|
|
|
|
|
|
- `security_group_id` (string) - The ID (*not* the name) of the security group
|
|
|
|
|
to assign to the instance. By default this is not set and Packer will
|
|
|
|
|
@ -264,9 +261,8 @@ builder.
|
|
|
|
|
|
|
|
|
|
- `snapshot_tags` (object of key/value strings) - Tags to apply to snapshot.
|
|
|
|
|
They will override AMI tags if already applied to snapshot. This is a
|
|
|
|
|
[template engine](/docs/templates/engine.html)
|
|
|
|
|
where the `SourceAMI` variable is replaced with the source AMI ID and
|
|
|
|
|
`BuildRegion` variable is replaced with the value of `region`.
|
|
|
|
|
[template engine](/docs/templates/engine.html),
|
|
|
|
|
see [Build template data](#build-template-data) for more information.
|
|
|
|
|
|
|
|
|
|
- `source_ami_filter` (object) - Filters used to populate the `source_ami` field.
|
|
|
|
|
Example:
|
|
|
|
|
@ -361,9 +357,8 @@ builder.
|
|
|
|
|
|
|
|
|
|
- `tags` (object of key/value strings) - Tags applied to the AMI and
|
|
|
|
|
relevant snapshots. This is a
|
|
|
|
|
[template engine](/docs/templates/engine.html)
|
|
|
|
|
where the `SourceAMI` variable is replaced with the source AMI ID and
|
|
|
|
|
`BuildRegion` variable is replaced with the value of `region`.
|
|
|
|
|
[template engine](/docs/templates/engine.html),
|
|
|
|
|
see [Build template data](#build-template-data) for more information.
|
|
|
|
|
|
|
|
|
|
- `temporary_key_pair_name` (string) - The name of the temporary key pair
|
|
|
|
|
to generate. By default, Packer generates a name that looks like
|
|
|
|
|
@ -462,6 +457,15 @@ configuration of `launch_block_device_mappings` will expand the root volume
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Build template data
|
|
|
|
|
|
|
|
|
|
The available variables are:
|
|
|
|
|
|
|
|
|
|
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is building the AMI.
|
|
|
|
|
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build the AMI.
|
|
|
|
|
- `SourceAMIName` - The source AMI Name (for example `ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to build the AMI.
|
|
|
|
|
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
|
|
|
|
|
|
|
|
|
|
## Tag Example
|
|
|
|
|
|
|
|
|
|
Here is an example using the optional AMI tags. This will add the tags
|
|
|
|
|
@ -481,7 +485,9 @@ images exist when this template is run:
|
|
|
|
|
"ami_name": "packer-quick-start {{timestamp}}",
|
|
|
|
|
"tags": {
|
|
|
|
|
"OS_Version": "Ubuntu",
|
|
|
|
|
"Release": "Latest"
|
|
|
|
|
"Release": "Latest",
|
|
|
|
|
"Base_AMI_Name": "{{ .SourceAMIName }}",
|
|
|
|
|
"Extra": "{{ .SourceAMITags.TagName }}"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|