Cassandra Astra securely deploying to heroku Cassandra Astra securely deploying to heroku heroku heroku

Cassandra Astra securely deploying to heroku


If you can checkin secure bundle into repo, then it should be easy - you just need to point to it from the cloud config map, and take username/password from the configured secrets via environment variables:

from cassandra.cluster import Clusterfrom cassandra.auth import PlainTextAuthProviderimport oscloud_config = {    'secure_connect_bundle': '/path/to/secure-connect-dbname.zip'}auth_provider = PlainTextAuthProvider(    username=os.environ['CASSANDRA_USERNAME'],     password=os.environ['CASSANDRA_PASSWORD'])cluster = Cluster(cloud=cloud_config, auth_provider=auth_provider)session = cluster.connect()

Idea about storing the file on S3, and downloading - isn't very bad as well. You can implement it in the script itself, to get file, and you can use environment variables to pass S3 credentials as well, so file won't be accessible in the repository, plus it would be easier to exchange the secure bundles if necessary.