

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立 Amazon Keyspaces 的程式設計存取憑證
<a name="programmatic.credentials"></a>

若要為使用者和應用程式提供 Amazon Keyspaces 資源的程式設計存取登入資料，您可以執行下列其中一項操作：
+ 建立與 Cassandra 用於身分驗證和存取管理的傳統使用者名稱和密碼類似的服務特定登入資料。 AWS 服務特定登入資料會與特定 AWS Identity and Access Management (IAM) 使用者建立關聯，並且只能用於為其建立的服務。如需詳細資訊，請參閱《[IAM 使用者指南》中的搭配使用 IAM 與 Amazon Keyspaces （適用於 Apache Cassandra)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_keyspaces.html)。
**警告**  
IAM 使用者具有長期憑證，這會造成安全風險。為了協助降低此風險，建議您只為這些使用者提供執行任務所需的許可，並在不再需要這些使用者時將其移除。
+ 為了增強安全性，建議您建立用於所有 AWS 服務的 IAM 身分，並使用暫時登入資料。Cassandra 用戶端驅動程式的 Amazon Keyspaces SigV4 身分驗證外掛程式可讓您使用 IAM 存取金鑰來驗證對 Amazon Keyspaces 的呼叫，而不是使用者名稱和密碼。若要進一步了解 Amazon Keyspaces SigV4 外掛程式如何讓 [IAM 使用者、角色和聯合身分](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)在 Amazon Keyspaces API 請求中驗證，請參閱[AWS 簽章第 4 版程序 (SigV4)](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)。

  您可以從下列位置下載 SigV4 外掛程式。
  + Java：[https://github.com/aws/aws-sigv4-auth-cassandra-java-driver-plugin](https://github.com/aws/aws-sigv4-auth-cassandra-java-driver-plugin)。
  + Node.js：[https://github.com/aws/aws-sigv4-auth-cassandra-nodejs-driver-plugin](https://github.com/aws/aws-sigv4-auth-cassandra-nodejs-driver-plugin)。
  + Python: [https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin](https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin).
  + Go：[https://github.com/aws/aws-sigv4-auth-cassandra-gocql-driver-plugin](https://github.com/aws/aws-sigv4-auth-cassandra-gocql-driver-plugin)。

  如需示範如何使用 SigV4 身分驗證外掛程式建立連線的程式碼範例，請參閱 [使用 Cassandra 用戶端驅動程式以程式設計方式存取 Amazon Keyspaces](programmatic.drivers.md)。

**Topics**
+ [建立服務特定的登入資料](programmatic.credentials.ssc.md)
+ [建立 IAM 登入資料以進行 AWS 身分驗證](access.credentials.md)