Skip to content

Commit

Permalink
Enable setting a description for EBS Volume Snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
saxonww authored and lbajolet-hashicorp committed Apr 16, 2024
1 parent cfc2f1e commit 4756795
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .web-docs/components/builder/ebsvolume/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concept

- `snapshot_volume` (bool) - Create a Snapshot of this Volume.

- `snapshot_description` (string) - The description for the snapshot.

<!-- End of code generated from the comments of the BlockDevice struct in builder/ebsvolume/block_device.go; -->


Expand Down
3 changes: 3 additions & 0 deletions builder/ebsvolume/block_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type BlockDevice struct {
// Create a Snapshot of this Volume.
SnapshotVolume bool `mapstructure:"snapshot_volume" required:"false"`

// The description for the snapshot.
SnapshotDescription string `mapstructure:"snapshot_description" required:"false"`

awscommon.SnapshotConfig `mapstructure:",squash"`
}

Expand Down
2 changes: 2 additions & 0 deletions builder/ebsvolume/builder.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions builder/ebsvolume/step_snapshot_ebs_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (s *stepSnapshotEBSVolumes) Run(ctx context.Context, state multistep.StateB
input := &ec2.CreateSnapshotInput{
VolumeId: aws.String(*instanceBlockDevice.Ebs.VolumeId),
TagSpecifications: []*ec2.TagSpecification{tagSpec},
Description: aws.String(configVolumeMapping.SnapshotDescription),
}

//Dont try to set an empty tag spec
Expand Down
2 changes: 2 additions & 0 deletions docs-partials/builder/ebsvolume/BlockDevice-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@

- `snapshot_volume` (bool) - Create a Snapshot of this Volume.

- `snapshot_description` (string) - The description for the snapshot.

<!-- End of code generated from the comments of the BlockDevice struct in builder/ebsvolume/block_device.go; -->

0 comments on commit 4756795

Please sign in to comment.