awsupload: Add description to snapshots

Make it easier to tell which snapshot goes with each AMI by labeling
them with a description.

Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
Major Hayden 2020-08-18 12:35:02 -05:00 committed by Major Hayden
parent 1dbc271506
commit fc7f6349eb

View file

@ -1,6 +1,7 @@
package awsupload
import (
"fmt"
"log"
"os"
"time"
@ -115,8 +116,10 @@ func WaitUntilImportSnapshotTaskCompletedWithContext(c *ec2.EC2, ctx aws.Context
func (a *AWS) Register(name, bucket, key string) (*string, error) {
log.Printf("[AWS] 📥 Importing snapshot from image: %s/%s", bucket, key)
snapshotDescription := fmt.Sprintf("Image Builder AWS Import of %s", name)
importTaskOutput, err := a.importer.ImportSnapshot(
&ec2.ImportSnapshotInput{
Description: aws.String(snapshotDescription),
DiskContainer: &ec2.SnapshotDiskContainer{
UserBucket: &ec2.UserBucket{
S3Bucket: aws.String(bucket),