• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elastic / cloudbeat / 12907939844

22 Jan 2025 12:12PM UTC coverage: 76.069%. First build
12907939844

Pull #2936

github

orouz
add AddCallerSkip and account for fetcher cancel logs
Pull Request #2936: Use custom logger to downgrade canceled context errors to warnings

151 of 177 new or added lines in 122 files covered. (85.31%)

8627 of 11341 relevant lines covered (76.07%)

17.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/resources/providers/awslib/lambda/lambda.go
1
// Licensed to Elasticsearch B.V. under one or more contributor
2
// license agreements. See the NOTICE file distributed with
3
// this work for additional information regarding copyright
4
// ownership. Elasticsearch B.V. licenses this file to you under
5
// the Apache License, Version 2.0 (the "License"); you may
6
// not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
//     http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17

18
package lambda
19

20
import (
21
        "context"
22

23
        "github.com/aws/aws-sdk-go-v2/aws"
24
        "github.com/aws/aws-sdk-go-v2/service/lambda"
25

26
        "github.com/elastic/cloudbeat/internal/resources/providers/awslib"
27
        "github.com/elastic/cloudbeat/internal/resources/utils/clog"
28
)
29

30
type Lambda interface {
31
        ListAliases(context.Context) ([]awslib.AwsResource, error)
32
        ListEventSourceMappings(context.Context) ([]awslib.AwsResource, error)
33
        ListFunctions(context.Context) ([]awslib.AwsResource, error)
34
        ListLayers(context.Context, string, string) ([]awslib.AwsResource, error)
35
}
36

NEW
37
func NewLambdaProvider(ctx context.Context, log *clog.Logger, cfg aws.Config, factory awslib.CrossRegionFactory[Client]) *Provider {
×
38
        f := func(cfg aws.Config) Client {
×
39
                return lambda.NewFromConfig(cfg)
×
40
        }
×
41
        m := factory.NewMultiRegionClients(ctx, awslib.AllRegionSelector(), cfg, f, log)
×
42
        return &Provider{
×
43
                log:     log,
×
44
                clients: m.GetMultiRegionsClientMap(),
×
45
        }
×
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc