Skip to content

Commit

Permalink
Add common/sigv4 with the sigv4 config
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Reid <tyler.reid@grafana.com>
  • Loading branch information
Tyler Reid committed Jun 23, 2021
1 parent bd82f70 commit a769006
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 31 deletions.
15 changes: 2 additions & 13 deletions config/notifiers.go
Expand Up @@ -20,6 +20,7 @@ import (
"time"

"github.com/pkg/errors"
"github.com/prometheus/common/sigv4"

commoncfg "github.com/prometheus/common/config"
)
Expand Down Expand Up @@ -589,25 +590,13 @@ func (c *PushoverConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
return nil
}

// SigV4Config is the configuration for signing remote write requests with
// AWS's SigV4 verification process. Empty values will be retrieved using the
// AWS default credentials chain.
// TODO: Move to common.
type SigV4Config struct {
Region string `yaml:"region,omitempty"`
AccessKey string `yaml:"access_key,omitempty"`
SecretKey Secret `yaml:"secret_key,omitempty"`
Profile string `yaml:"profile,omitempty"`
RoleARN string `yaml:"role_arn,omitempty"`
}

type SNSConfig struct {
NotifierConfig `yaml:",inline" json:",inline"`

HTTPConfig *commoncfg.HTTPClientConfig `yaml:"http_config,omitempty" json:"http_config,omitempty"`

APIUrl string `yaml:"api_url,omitempty" json:"api_url,omitempty"`
Sigv4 SigV4Config `yaml:"sigv4" json:"sigv4"`
Sigv4 sigv4.SigV4Config `yaml:"sigv4" json:"sigv4"`
TopicARN string `yaml:"topic_arn,omitempty" json:"topic_arn,omitempty"`
PhoneNumber string `yaml:"phone_number,omitempty" json:"phone_number,omitempty"`
TargetARN string `yaml:"target_arn,omitempty" json:"target_arn,omitempty"`
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Expand Up @@ -23,16 +23,17 @@ require (
github.com/oklog/run v1.1.0
github.com/oklog/ulid v1.3.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/common v0.24.0
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.29.0
github.com/prometheus/common/sigv4 v0.1.0
github.com/prometheus/exporter-toolkit v0.5.1
github.com/rs/cors v1.7.0
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/stretchr/testify v1.7.0
github.com/xlab/treeprint v1.1.0
go.uber.org/atomic v1.5.0
golang.org/x/net v0.0.0-20210421230115-4e50805a0758
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/tools v0.1.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
Expand Down

0 comments on commit a769006

Please sign in to comment.