Skip to content

Commit

Permalink
switched SNS to argus (#168)
Browse files Browse the repository at this point in the history
* switched SNS to argus

* integrate chrysom, add unit tests

* bump argus to v0.3.3

* bump webpa-common

* update pr from recommendations

* Apply suggestions from code review

Co-authored-by: Joel Unzain <joe94@users.noreply.github.com>
  • Loading branch information
kcajmagic and joe94 committed Jul 7, 2020
1 parent a4b5d54 commit 9396233
Show file tree
Hide file tree
Showing 9 changed files with 551 additions and 197 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

- switched SNS to argus [#168](https://github.com/xmidt-org/tr1d1um/pull/168)

## [v0.5.1]
### Fixed
Expand Down
90 changes: 32 additions & 58 deletions deploy/packaging/tr1d1um_spruce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,67 +119,41 @@ log:
##############################################################################
# Webhooks Related configuration
##############################################################################
# webhookStore provides configuration for storing and obtaining webhook
# information using argus.
webhookStore:

# webhooksEnabled indicates whether or not the webhooks server should be started
# It is disabled for local testing
webhooksEnabled: false
# bucket to store and retrieve webhooks.
bucket: (( grab $AUTH_HEADER || "webhooks-caduceus" ))

# The unique fully-qualified-domain-name of the server. The webhooks library uses it
# to know which host to use to confirm this service is ready to receive events
# (Optional if not running webhooks)
fqdn: (( grab $FQDN || $HOSTNAME || "tr1d1um" ))
# address it the location to talk to argus.
address: (( grab $ARGUS_ENDPOINT || "http://argus:6600" ))

# start contains configuration for the logic by which Tr1d1um can
# fetch the current WebPA webhooks without having to wait for SNS
# It does so by pinging the rest of the cluter at the specified apiPath
# More details at https://godoc.org/github.com/xmidt-org/webpa-common/webhook#StartConfig
start:
# duration is the max amount of time allowed to wait for webhooks data to be retrieved
duration: "20s"
# pullInterval is how often to call argus to update the webhook structure.
pullInterval: "0s"

# path used to query the existing webhooks
apiPath: http://localhost:6100/hooks

########################################
# Webhooks DNS readiness Configuration
########################################

# WaitForDns is the duration the webhooks library will wait for this server's DNS record to be
# propagated. This waiting logic is important so AWS SNS webhook confirmations are not missed
waitForDns: "30s"

#soa stands for Start of Authority and it's a type of record in a DNS
soa:
# provider is the SOA provider used to verify DNS record readiness of this service
provider: "example-123.awsdns-00.com:17"

########################################
# Webhooks AWS SNS Configuration
########################################

# aws provides the AWS SNS configurations the webhooks library needs
aws:
#AWS access key
accessKey: (( grab $AWS_ACCESS_KEY || "" ))

#AWS secret key
secretKey: (( grab $AWS_SECRET_KEY || "" ))

env: (( grab $AWS_WEBHOOK_ENV || "local-dev" ))

sns:
# awsEndpoint is the AWS endpoint
# this must be left out in produ
awsEndpoint: (( grab $AWS_ENDPOINT || "http://goaws:4100" ))

#region is the AWS SNS region
region: (( grab $AWS_REGION || "us-east-1" ))

# topicArn describes the SNS topic this server needs to subscribe to
topicArn: (( grab $AWS_SNS_ARN || "arn:aws:sns:us-east-1:000000000000:xmidt-local-caduceus"))

#urlPath is the URL path SNS will use to confirm a subscription with this server
urlPath: "/api/v2/aws/sns"
# auth the authentication method for argus.
auth:
# basic configures basic authentication for argus.
# Must be of form: 'Basic xyz=='
basic: (( concat "Basic " authToken ))
#
# # jwt configures jwt style authentication for argus.
# JWT:
# # requestHeaders are added to the request for the token.
# # (Optional)
# # requestHeaders:
# # "": ""
#
# # authURL is the URL to access for the token.
# authURL: ""
#
# # timeout is how long the request to get the token will take before
# # timing out.
# timeout: "1m"
#
# # buffer is the length of time before a token expires to get a new token.
# buffer: "2m"


##############################################################################
Expand Down Expand Up @@ -293,4 +267,4 @@ authAcquirer:
# buffer is the length of time before a token expires to get a new token.
buffer: "2m"

Basic: (( concat "Basic " authToken ))
Basic: (( concat "Basic " authToken ))
16 changes: 6 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ module github.com/xmidt-org/tr1d1um
go 1.14

require (
github.com/aws/aws-sdk-go v1.23.11 // indirect
github.com/c9s/goprocinfo v0.0.0-20190309065803-0b2ad9ac246b // indirect
github.com/go-kit/kit v0.8.0
github.com/go-kit/kit v0.9.0
github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b
github.com/gorilla/mux v1.7.3
github.com/influxdata/influxdb v1.7.7 // indirect
github.com/justinas/alice v1.2.0
github.com/pkg/errors v0.8.1 // indirect
github.com/prometheus/client_golang v1.0.0 // indirect
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.3.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.5.1
github.com/xmidt-org/argus v0.3.3
github.com/xmidt-org/bascule v0.8.1
github.com/xmidt-org/webpa-common v1.7.0
github.com/xmidt-org/webpa-common v1.10.2
github.com/xmidt-org/wrp-go v1.3.3
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 // indirect
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 // indirect
)
Loading

0 comments on commit 9396233

Please sign in to comment.