JeremyGrosser / tablesnap

Uses inotify to monitor Cassandra SSTables and upload them to S3
BSD 2-Clause "Simplified" License
181 stars 86 forks source link

Secret key and token may not be required if the IAM profile is configured #80

Closed bhvijaykumar closed 6 years ago

bhvijaykumar commented 7 years ago

Currently the secret key and token is passed to boto.s3 API , but in case of IAM profile with S3 access configured for the instance , we will not need the secret key / token . boto API documents this saying we need not pass the key/token

But the tablesnap and related scripts fail as they try to pass the key and tokens. I think if the secretkey is not provided we need to just call boto.s3.connect_to_region(self.region) API

JeremyGrosser commented 7 years ago

Do you get an error when you supply a token but not the key/secret? Just looking at the code, it should pass the None values along to the boto.connect_s3 method.

mini-sledge commented 7 years ago

If an IAM role is present on the EC2 instance, I don't need to pass a key, secret, or token. It does currently fail if none of these are passed in. Additionally, the readme does not list any documentation for the token. Pull requests welcome?

JeremyGrosser commented 7 years ago

Yeah, tablesnap was written before IAM roles could be assigned to instances, so it was never tested without explicit credentials. Yes, patches are welcome.