

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 最佳实践
<a name="best-practices"></a>

## 配置和 CI/CD 自动化
<a name="ci-cd"></a>

MongoDB Atlas 可通过以下方式进行配置。 AWS Marketplace您可以订阅 [pay-as-you-goMongoDB Atlas](https://aws.amazon.com/marketplace/pp/prodview-pp445qepfdy34) 选项 AWS 进行付款，无需任何预先承诺。选择 [Atlas 永久免费套餐](https://www.mongodb.com/pricing)，即可获得一个免费的起点，并可根据需要进行扩展。有关这些选项的更多信息，请参阅 MongoDB 网站上的博客文章：[Introducing Pay as You Go MongoDB Atlas on AWS Marketplace](https://www.mongodb.com/blog/post/introducing-pay-as-you-go-mongodb-atlas-aws-marketplace)。

您可以使用模板和来部署 MongoDB Atlas 基础设施资源。 CloudFormation AWS Cloud Development Kit (AWS CDK)这种方法有助于推进持续集成和持续交付（CI/CD）自动化。欲了解更多信息，请参阅 [MongoDB 网站上的博客文章 MongoDB Atlas 集成 CloudFormation ，CDK 现已正式上线](https://www.mongodb.com/blog/post/atlas-integrations-aws-cloud-formation-cdk-now-generally-available)。

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

您可以通过具有多种身份验证选项的安全专用网络连接到 MongoDB Atlas AWS 服务 ：
+ 使用 VPC 对等 AWS 服务 连接或 AWS PrivateLink配置数据库之间的连接。
+ 使用 [AWS IAM Identity Center](https://aws.amazon.com/iam/identity-center/) 实施 SAML 2.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 网站上的博客文章 MongoDB Atlas 集成 CloudFormation ，CDK 现已正式上线](https://www.mongodb.com/blog/post/atlas-integrations-aws-cloud-formation-cdk-now-generally-available)。

下图展示了私有网络连接选项。

![\[将 MongoDB Atlas AWS PrivateLink与集成，用于私有网络连接。\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/migration-mongodb-atlas/images/private-connectivity.png)


AWS PrivateLink 提供以下好处：
+ 单向连接：不延伸网络信任边界。
+ 通过专用网络整合跨 AWS 应用程序和环境的安全控制。
+  能够将虚拟专用网络 (VPN) 与 VPC 对等连接结合使用 PrivateLink，或者适用于想要从 AWS 环境中访问 Atlas 的开发人员。

### 实施 SAML 2.0 身份验证
<a name="saml-authentication"></a>

Atlas 通过与 IAM Identity Center 和其他身份管理提供商集成，支持 SAML 2.0 身份验证。SAML 2.0 身份验证是在应用程序和服务提供商之间交换身份和安全信息的开放标准。Atlas 管理员可以使用身份管理服务（例如 IAM Identity Center）或现有的公司目录服务，集中管理用户和实现单点登录。下图展示了 IAM Identity Center 可如何与 Atlas 配合使用。有关更多信息，请参阅 AWS 博客文章《[如何将 IAM 身份中心与 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_cn/prescriptive-guidance/latest/migration-mongodb-atlas/images/saml-authentication.png)


[有关在 AWS上使用 MongoDB Atlas 的其他最佳实践，请参阅博客。AWS Partner Network](https://aws.amazon.com/blogs/apn/tag/mongodb-atlas/)