Skip to content

Commit

Permalink
builder: improve documentation on virtual_name
Browse files Browse the repository at this point in the history
The `virtual_name` attribute for block devices did not have a clear
documentation, which led to confusion for users of the plugin.

This commit enhances this to clarify these are expected to have a
specific format, and are only for instance-based (ephemeral) volumes.
  • Loading branch information
lbajolet-hashicorp committed Jun 3, 2024
1 parent a89fa76 commit 03e3eac
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .web-docs/components/builder/chroot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,14 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion .web-docs/components/builder/ebs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,14 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion .web-docs/components/builder/ebssurrogate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,14 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion .web-docs/components/builder/ebsvolume/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,14 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion .web-docs/components/builder/instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,14 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion builder/common/block_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ type BlockDevice struct {
// [Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
// for more information
Throughput *int64 `mapstructure:"throughput" required:"false"`
// The virtual device name. See the documentation on Block Device Mapping
// The virtual device name. See the documentation on
// [Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
// for more information.
//
// Note: virtual_name only applies for ephemeral (instance) volumes. Any
// EBS-backed volume will have a `snapshot_id` instead.
//
// The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1
VirtualName string `mapstructure:"virtual_name" required:"false"`
// The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
// for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down
8 changes: 7 additions & 1 deletion docs-partials/builder/common/BlockDevice-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
[Throughput](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html)
for more information

- `virtual_name` (string) - The virtual device name. See the documentation on Block Device Mapping
- `virtual_name` (string) - The virtual device name. See the documentation on
[Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
for more information.

Note: virtual_name only applies for ephemeral (instance) volumes. Any
EBS-backed volume will have a `snapshot_id` instead.

The volume virtual_name should be in the `ephemeral[0-23]` form, e.g. ephemeral1

- `volume_type` (string) - The volume type. gp2 & gp3 for General Purpose (SSD) volumes, io1 & io2
for Provisioned IOPS (SSD) volumes, st1 for Throughput Optimized HDD,
Expand Down

0 comments on commit 03e3eac

Please sign in to comment.