Skip to content

Commit e8db536

Browse files
authored
Merge pull request pingcap#5 from xu21yingan/patch-3
Fix missing required attribute for ec2-api
2 parents cf21c7e + 4b9a3e6 commit e8db536

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

br/pkg/aws/ebs.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ func (e *EC2Session) CreateSnapshots(backupInfo *config.EBSBasedBRMeta) (map[str
7373
TagSpecifications: []*ec2.TagSpecification{
7474
{
7575
ResourceType: aws.String(ec2.ResourceTypeSnapshot),
76+
Tags: []*ec2.Tag{
77+
ec2Tag("TiDBCluster-BR", "old"),
78+
},
7679
},
7780
},
7881
})
@@ -153,7 +156,17 @@ func (e *EC2Session) DeleteSnapshots(snapIDMap map[string]string) {
153156
// if err happens in the middle, return half-done result
154157
// returned map: store id -> old volume id -> new volume id
155158
func (e *EC2Session) CreateVolumes(meta *config.EBSBasedBRMeta, volumeType string, iops, throughput int64) (map[string]string, error) {
156-
template := ec2.CreateVolumeInput{VolumeType: &volumeType}
159+
template := ec2.CreateVolumeInput{
160+
VolumeType: &volumeType,
161+
TagSpecifications: []*ec2.TagSpecification{
162+
{
163+
ResourceType: aws.String(ec2.ResourceTypeVolume),
164+
Tags: []*ec2.Tag{
165+
ec2Tag("TiDBCluster-BR", "new"),
166+
},
167+
},
168+
},
169+
}
157170
if iops > 0 {
158171
template.SetIops(iops)
159172
}

0 commit comments

Comments
 (0)