CloudWatch: Use context in aws DescribeRegionsWithContext (#76922)
* Use context in aws DescribeRegionsWithContext In the current way, DescribeRegions is used which doesn't allow cancelling the request if the context changes. Using DescribeRegionsWithContext is the preferred way. * Fix context variable * Revert GetRegionsWithContext to GetRegions GetRegions is not an AWS SDK method. Hence, GetRegions should be enough as the name change is not needed for context implementation.
This commit is contained in:
@@ -46,7 +46,7 @@ type AccountsProvider interface {
|
||||
}
|
||||
|
||||
type RegionsAPIProvider interface {
|
||||
GetRegions() ([]resources.ResourceResponse[resources.Region], error)
|
||||
GetRegions(ctx context.Context) ([]resources.ResourceResponse[resources.Region], error)
|
||||
}
|
||||
|
||||
// Clients
|
||||
@@ -70,6 +70,6 @@ type OAMAPIProvider interface {
|
||||
}
|
||||
|
||||
type EC2APIProvider interface {
|
||||
DescribeRegions(in *ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error)
|
||||
DescribeRegionsWithContext(ctx context.Context, in *ec2.DescribeRegionsInput, opts ...request.Option) (*ec2.DescribeRegionsOutput, error)
|
||||
DescribeInstancesPagesWithContext(ctx context.Context, in *ec2.DescribeInstancesInput, fn func(*ec2.DescribeInstancesOutput, bool) bool, opts ...request.Option) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user