I created a keyspace in eu-west-3.
When I try with the same query in cqlsh it works but with golang doesn't. Someone can help me?
cluster := gocql.NewCluster("cassandra.eu-west-3.amazonaws.com:9142")
cluster.ConnectTimeout = time.Second * 10
var auth sigv4.AwsAuthenticator = sigv4.NewAwsAuthenticator()
auth.Region = "eu-west-3"
auth.AccessKeyId = "ex"
auth.SecretAccessKey = "ex"
cluster.Authenticator = auth
cluster.SslOpts = &gocql.SslOptions{
CaPath: "./sf-class2-root.crt",
EnableHostVerification: false,
}
cluster.Consistency = gocql.LocalQuorum
cluster.DisableInitialHostLookup = true
session, err := cluster.CreateSession()
if err != nil {
fmt.Println("err>", err)
return
}
session.Query("INSERT INTO ex.accounts (id, username, email) VALUES (uuid(),'user1','user1@gmail.com' ) ;")