eventrouter
eventrouter copied to clipboard
S3Sink - should support instance-profile for bucket access
Currently the s3sink interface panics if s3SinkAccessKeyID / s3SinkSecretAccessKey are not provided.
case "s3sink":
accessKeyID := viper.GetString("s3SinkAccessKeyID")
if accessKeyID == "" {
panic("s3 sink specified but s3SinkAccessKeyID not specified")
}
secretAccessKey := viper.GetString("s3SinkSecretAccessKey")
if secretAccessKey == "" {
panic("s3 sink specified but s3SinkSecretAccessKey not specified")
Ignoring the fact that this should probably use a secret vs. a configmap to store this secret, for my use-case I need to use an instance profile to access the bucket.
This will not work with current code as it simply panics.
Suggested change:
- if key/secret not provided, check if instance-profile is attached
- if instance-profile is attached and no creds provided, use the instance-profile to try and access the bucket
- if both not provided (no instance-profile attached) - panic.
Happy to send a PR for this if you are open to having eventrouter support instance-profile for access.
Is this project still active? no release here for the last year+
s3sink support for instance-profile is appreciated.
I will try to include this in #82