-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding feature to support AWS Signing and creating new index per day #302
Conversation
…using DD-MM-YYYY suffix
…using DD-MM-YYYY suffix
…om/infracloudio/botkube into feature/support-aws-signing-for-es
comm_config.yaml
Outdated
awsRegion: "us-east-1" # AWS region where Elasticsearch is deployed | ||
awsAccessKey: "" | ||
awsSecretKey: "" | ||
server: "" # e.g https://example.com:9243 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server: "" # e.g https://example.com:9243 | |
server: 'ELASTICSEARCH_ADDRESS' # e.g https://example.com:9243 |
pkg/config/config.go
Outdated
Name string | ||
Type string | ||
Shards int | ||
Replicas int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run go fmt
. I don't think this change is required
pkg/notify/elasticsearch.go
Outdated
awsClient, err := aws_signing_client.New( | ||
signer, | ||
nil, | ||
"es", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "es"? Please declare it as a const.
pkg/notify/elasticsearch.go
Outdated
// Get credentials from environment variables and create the AWS Signature Version 4 signer | ||
creds := credentials.NewEnvCredentials() | ||
signer := v4.NewSigner(creds) | ||
awsClient, err := aws_signing_client.New( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the function params in single line. It easier to read that way
pkg/notify/elasticsearch.go
Outdated
@@ -78,7 +121,7 @@ func (e *ElasticSearch) SendEvent(event events.Event) (err error) { | |||
event.Cluster = e.ClusterName | |||
|
|||
// Create index if not exists | |||
exists, err := e.ELSClient.IndexExists(e.Index).Do(ctx) | |||
exists, err := e.ELSClient.IndexExists(e.Index + "-" + time.Now().Format("02-01-2006")).Do(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please declare format string as a const and use that
@kartik-moolya Please run |
5f5073b
to
65af86f
Compare
Please fix the gofmt issues. |
e63e711
to
cf3beff
Compare
ISSUE TYPE
SUMMARY
Allows user to specify if Elasticsearch is hosted on AWS
Includes feature which would allow botkube to send Kubernetes events to Elasticsearch hosted on AWS
Secondly creates new index per day with index name suffixed as -DD-MM-YYYY
Fixes #299
Fixes #283