

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

# 最佳實務
<a name="best-practices"></a>

## 佈建和 CI/CD 自動化
<a name="ci-cd"></a>

MongoDB Atlas 可透過 佈建 AWS Marketplace。您可以訂閱 [pay-as-you-go MongoDB Atlas 選項](https://aws.amazon.com/marketplace/pp/prodview-pp445qepfdy34)， AWS 無需任何預付承諾。選擇 [Atlas 免費永久方案](https://www.mongodb.com/pricing)可提供免費的起點，並可視需要擴展。如需這些選項的詳細資訊，請參閱 [ MongoDB 網站上的 部落格文章介紹 Pay as You Go MongoDB Atlas AWS Marketplace](https://www.mongodb.com/blog/post/introducing-pay-as-you-go-mongodb-atlas-aws-marketplace)。 MongoDB 

您可以使用 CloudFormation 範本和 部署 MongoDB Atlas 基礎設施資源 AWS Cloud Development Kit (AWS CDK)。此方法有助於持續整合和持續交付 (CI/CD) 自動化。如需詳細資訊，請參閱 [MongoDB 網站現已全面推出適用於 CloudFormation 和 CDK 的 MongoDB Atlas 整合](https://www.mongodb.com/blog/post/atlas-integrations-aws-cloud-formation-cdk-now-generally-available)部落格文章。 MongoDB 

## 安全
<a name="security"></a>

您可以透過具有多個身分驗證選項的安全私有網路， AWS 服務 從 連線至 MongoDB Atlas：
+ 使用 VPC 對等互連 或 AWS 服務 設定資料庫與 之間的連線 AWS PrivateLink。
+ 使用 實作 SAML 2[AWS IAM Identity Center](https://aws.amazon.com/iam/identity-center/).0 身分驗證。
+ 使用 [AWS Identity and Access Management (IAM) 使用整合式身分驗證。](https://www.mongodb.com/docs/atlas/security/aws-iam-authentication/)
+ 搭配 [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)和 [AWS Key Management Service (AWS KMS)](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 使用整合式安全登入資料。

下列各節會更詳細地描述這些整合。

### 私有網路連線
<a name="private-connectivity"></a>

您可以使用 AWS PrivateLink 將 MongoDB Atlas 連接到您的 AWS 應用程式，並確保所有 AWS 服務 和 帳戶之間的私有連線。如需詳細資訊，請參閱 [MongoDB 網站上的適用於 CloudFormation 和 CDK 的 MongoDB Atlas 整合部落格文章。](https://www.mongodb.com/blog/post/atlas-integrations-aws-cloud-formation-cdk-now-generally-available) MongoDB 

下圖說明私有網路連線選項。

![\[將 MongoDB Atlas 與 整合 AWS PrivateLink，以進行私有網路連線。\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/migration-mongodb-atlas/images/private-connectivity.png)


AWS PrivateLink 提供以下優點：
+ 單向連線：網路信任界限沒有延伸。
+ 透過私有聯網跨 AWS 應用程式和環境整合安全控制。
+  對於想要從 AWS 環境存取 Atlas 的開發人員，能夠使用虛擬私有網路 (VPN) 搭配 VPC 對等互連或 PrivateLink。

### 實作 SAML 2.0 身分驗證
<a name="saml-authentication"></a>

Atlas 透過與 IAM Identity Center 和其他身分管理提供者整合，支援 SAML 2.0 身分驗證。SAML 2.0 身分驗證是一項開放標準，用於在應用程式和服務提供者之間交換身分和安全資訊。Atlas 管理員可以使用身分管理服務，例如 IAM Identity Center 或現有的公司目錄服務，集中使用者管理和單一登入。下圖顯示如何搭配 Atlas 使用 IAM Identity Center。如需詳細資訊，請參閱 AWS 部落格文章[如何整合 IAM Identity Center 與 MongoDB Atlas](https://aws.amazon.com/blogs/apn/how-to-integrate-aws-single-sign-on-with-mongodb-atlas/)。

![\[整合 MongoDB Atlas 與 IAM Identity Center，以實作 SAML 2.0 身分驗證。\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/migration-mongodb-atlas/images/saml-authentication.png)


如需在 上使用 MongoDB Atlas 的其他最佳實務 AWS，請參閱[AWS Partner Network 部落格](https://aws.amazon.com/blogs/apn/tag/mongodb-atlas/)。