@@ -27,7 +27,7 @@ import (
2727 "sync"
2828 "time"
2929
30- "github.com/aws/aws-sdk-go/service/ec2"
30+ "github.com/aws/aws-sdk-go-v2 /service/ec2"
3131)
3232
3333// createTagsBatcher contains the batcher details
@@ -43,7 +43,7 @@ func newCreateTagsBatcher(ctx context.Context, ec2api iface.EC2) *createTagsBatc
4343 MaxTimeout : 1 * time .Second ,
4444 MaxItems : 50 ,
4545 RequestHasher : createTagsHasher ,
46- BatchExecutor : execCreateTagsBatch (ec2api ),
46+ BatchExecutor : execCreateTagsBatch (ctx , ec2api ),
4747 }
4848 return & createTagsBatcher {batcher : batcher .NewBatcher (ctx , options )}
4949}
@@ -67,7 +67,7 @@ func createTagsHasher(ctx context.Context, input *ec2.CreateTagsInput) uint64 {
6767 return hash
6868}
6969
70- func execCreateTagsBatch (ec2api iface.EC2 ) batcher.BatchExecutor [ec2.CreateTagsInput , ec2.CreateTagsOutput ] {
70+ func execCreateTagsBatch (ctx context. Context , ec2api iface.EC2 ) batcher.BatchExecutor [ec2.CreateTagsInput , ec2.CreateTagsOutput ] {
7171 return func (ctx context.Context , inputs []* ec2.CreateTagsInput ) []batcher.Result [ec2.CreateTagsOutput ] {
7272 results := make ([]batcher.Result [ec2.CreateTagsOutput ], len (inputs ))
7373 firstInput := inputs [0 ]
@@ -80,7 +80,7 @@ func execCreateTagsBatch(ec2api iface.EC2) batcher.BatchExecutor[ec2.CreateTagsI
8080 Tags : firstInput .Tags ,
8181 }
8282 klog .Infof ("Batched create tags %v" , batchedInput )
83- output , err := ec2api .CreateTags (batchedInput )
83+ output , err := ec2api .CreateTags (ctx , batchedInput )
8484
8585 if err != nil {
8686 klog .Errorf ("Error occurred trying to batch tag resources, trying individually, %v" , err )
@@ -89,7 +89,7 @@ func execCreateTagsBatch(ec2api iface.EC2) batcher.BatchExecutor[ec2.CreateTagsI
8989 wg .Add (1 )
9090 go func (input * ec2.CreateTagsInput ) {
9191 defer wg .Done ()
92- out , err := ec2api .CreateTags (input )
92+ out , err := ec2api .CreateTags (ctx , input )
9393 results [idx ] = batcher.Result [ec2.CreateTagsOutput ]{Output : out , Err : err }
9494
9595 }(input )
0 commit comments