簡體   English   中英

我應該為 Amazon Keyspaces(托管 Cassandra)使用哪個用戶名和密碼?

[英]Which username and password should I use for Amazon Keyspaces (managed Cassandra)?

由於身份驗證錯誤,我無法使用 .NET Core 連接到 AWS Keyspaces:

AuthenticationException '提供的用戶名 nick 和/或密碼不正確')

我不確定應該給PlainTextAuthProvider什么值。

我試過使用:

  • 我的 AWS 控制台憑證
  • AWS 訪問密鑰/秘密密鑰對

如何為 AWS Keyspaces 生成憑證?


我的代碼,如果它是相關的:

open System
open Cassandra

[<EntryPoint>]
let main argv = 
  async {    
    let cluster =
      Cluster.Builder()
        .AddContactPoints("cassandra.eu-west-2.amazonaws.com")
        .WithPort(9142)
        .WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
        .WithSSL()
        .Build()

    use! session =
      cluster.ConnectAsync ()
      |> Async.AwaitTask

    ()
  }
  |> Async.RunSynchronously

  0

該選項位於IAM 部分

導航至:

  • “服務”下拉菜單
  • 單擊“身份和訪問管理 (IAM)”
  • 打開“用戶”選項卡
  • 點擊你的用戶名
  • 打開“安全憑據”選項卡
  • 滾動到“Amazon Keyspaces 的憑據”部分
  • 點擊“生成憑證”

在此處輸入圖像描述

這將顯示一個彈出窗口,您可以在其中生成憑據。


此外,代碼應指定一個 Keyspace:

open System
open Cassandra

[<EntryPoint>]
let main argv = 
  async {    
    let cluster =
      Cluster.Builder()
        .AddContactPoints("cassandra.eu-west-2.amazonaws.com")
        .WithPort(9142)
        .WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
        .WithSSL()
        .Build()

    use! session =
      cluster.ConnectAsync "test_keyspace"
      |> Async.AwaitTask

    ()
  }
  |> Async.RunSynchronously

  0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM