From c7fc744fa4dcb0277b6c1b0bf905780745f168ab Mon Sep 17 00:00:00 2001 From: Andre Ziviani Date: Tue, 13 Jun 2023 19:50:40 -0300 Subject: [PATCH] fix: Assume role --- exporter/aws.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/exporter/aws.go b/exporter/aws.go index 7ec9462..089bd93 100644 --- a/exporter/aws.go +++ b/exporter/aws.go @@ -66,11 +66,8 @@ func (m *Metrics) NewHealthClient(ctx context.Context) { cname = strings.TrimSuffix(cname, ".") region := strings.Split(cname, ".")[1] - cfg, err := newAWSConfig(ctx, config.WithRegion(region)) - - if err != nil { - panic(err.Error()) - } + cfg := m.awsconfig + cfg.Region = region m.health = health.NewFromConfig(cfg, health.WithEndpointResolver(health.EndpointResolverFromURL(fmt.Sprintf("https://%s", cname)))) }