doc ebsvolume builder using partials

pull/7724/head
Adrien Delorme 7 years ago
parent 4c1abf828c
commit 8cea5d409a

@ -10,8 +10,6 @@ import (
type BlockDevice struct {
awscommon.BlockDevice `mapstructure:",squash"`
OmitFromArtifact bool `mapstructure:"omit_from_artifact"`
// Tags applied to the AMI. This is a
// template engine, see Build template
// data for more information.
@ -37,13 +35,3 @@ func (bds BlockDevices) Prepare(ctx *interpolate.Context) (errs []error) {
}
return errs
}
func (b BlockDevices) GetOmissions() map[string]bool {
omitMap := make(map[string]bool)
for _, blockDevice := range b {
omitMap[blockDevice.DeviceName] = blockDevice.OmitFromArtifact
}
return omitMap
}

@ -24,8 +24,15 @@ type Config struct {
common.PackerConfig `mapstructure:",squash"`
awscommon.AccessConfig `mapstructure:",squash"`
awscommon.RunConfig `mapstructure:",squash"`
// Add the block device mappings to the AMI. The block device mappings
// allow for keys:
// Add the block device mappings to the AMI. If you add instance store
// volumes or EBS volumes in addition to the root device volume, the
// created AMI will contain block device mapping information for those
// volumes. Amazon creates snapshots of the source instance's root volume
// and any other EBS volumes described here. When you launch an instance
// from this new AMI, the instance automatically launches with these
// additional volumes, and will restore them from snapshots taken from the
// source instance. See the [BlockDevices](#block-devices-configuration)
// documentation for fields.
VolumeMappings BlockDevices `mapstructure:"ebs_volumes" required:"false"`
// Enable enhanced networking (ENA but not SriovNetSupport) on
// HVM-compatible AMIs. If set, add ec2:ModifyInstanceAttribute to your AWS

@ -31,25 +31,56 @@ and key pairs Packer is able to operate on.
## Configuration Reference
There are many configuration options available for the builder. They are
segmented below into two categories: required and optional parameters. Within
each category, the available configuration keys are alphabetized.
There are many configuration options available for the builder. In addition to
the items listed here, you will want to look at the general configuration
references for [AMI](#ami-configuration),
[BlockDevices](#block-devices-configuration),
[Access](#acces-configuration),
[Run](#run-configuration) and
[Communicator](#communicator-configuration)
configuration references, which are
necessary for this build to succeed and can be found further down the page.
In addition to the options listed here, a
[communicator](/docs/templates/communicator.html) can be configured for this
builder.
### Optional:
<%= partial "partials/builder/amazon/ebsvolume/Config-not-required" %>
### Required:
### Acces Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AccessConfig-required" %>
<%= partial "partials/builder/amazon/common/RunConfig-required" %>
### Optional:
#### Optional:
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
### Block Devices Configuration
Block devices can be nested in the
[ebs_volumes](#ebs_volumes) array.
<%= partial "partials/builder/amazon/common/BlockDevice" %>
#### Optional:
<%= partial "partials/builder/amazon/common/BlockDevice-not-required" %>
<%= partial "partials/builder/amazon/ebsvolume/BlockDevice-not-required" %>
### Run Configuration
#### Required:
<%= partial "partials/builder/amazon/common/RunConfig-required" %>
#### Optional:
<%= partial "partials/builder/amazon/common/RunConfig-not-required" %>
<%= partial "partials/builder/amazon/ebsvolume/Config-not-required" %>
<%= partial "partials/builder/amazon/common/RunConfig-not-required" %>
### Communicator Configuration
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
## Basic Example

@ -1,6 +1,5 @@
<!-- Code generated from the comments of the BlockDevice struct in builder/amazon/ebsvolume/block_device.go; DO NOT EDIT MANUALLY -->
- `omit_from_artifact` (bool) - Omit From Artifact
- `tags` (awscommon.TagMap) - Tags applied to the AMI. This is a
template engine, see Build template
data for more information.

@ -1,7 +1,14 @@
<!-- Code generated from the comments of the Config struct in builder/amazon/ebsvolume/builder.go; DO NOT EDIT MANUALLY -->
- `ebs_volumes` (BlockDevices) - Add the block device mappings to the AMI. The block device mappings
allow for keys:
- `ebs_volumes` (BlockDevices) - Add the block device mappings to the AMI. If you add instance store
volumes or EBS volumes in addition to the root device volume, the
created AMI will contain block device mapping information for those
volumes. Amazon creates snapshots of the source instance's root volume
and any other EBS volumes described here. When you launch an instance
from this new AMI, the instance automatically launches with these
additional volumes, and will restore them from snapshots taken from the
source instance. See the [BlockDevices](#block-devices-configuration)
documentation for fields.
- `ena_support` (*bool) - Enable enhanced networking (ENA but not SriovNetSupport) on
HVM-compatible AMIs. If set, add ec2:ModifyInstanceAttribute to your AWS

Loading…
Cancel
Save