对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

设置统一云提供商集成

某些Atlas功能(包括Data Federation和静态加密)使用Amazon Web Services IAM 角色进行身份验证。当 Atlas 访问 Amazon Web Services 服务时,它会 担任 IAM 角色。

You can set up an assumed IAM role for your Atlas account to use with the Atlas Administration API or Atlas UI if you have the Project Owner role. Atlas supports unified access only for AWS.

您可以使用Atlas Kubernetes Operator为 AtlasProject 自定义资源中的 AWS IAM角色设立统一访问权限。

重要

If you operate Atlas Kubernetes Operator under an independent CRD model, you cannot configure AWS IAM authentication using atlasProject parameters. To configure AWS IAM authentication for your Atlas project directly, please see Set Up Authentication with AWS IAM.

您需要以下公共 API 密钥、私有 API 密钥和组织 ID 信息, 配置 Atlas Kubernetes Operator 对 Atlas 的访问权限。

您还可以使用 Service Accounts 作为 API 密钥的替代。

要了解更多信息,请参阅配置对 Atlas 的访问权限。

1
  1. 在 spec.cloudProviderIntegrations.iamAssumedRoleArn 中指定一个空值占位符AtlasProject 自定义资源的参数。

  2. 在 spec.cloudProviderIntegrations.providerName 中指定 AWSAtlasProject 自定义资源的参数。

示例:

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test Project
projectIpAccessList:
- ipAddress: "192.0.2.15"
comment: "IP address for Application"
cloudProviderIntegrations:
- providerName: "AWS"
iamAssumedRoleArn: ""
EOF

重要

在向AtlasProject自定义资源添加任何其他访问角色之前,请先完成整个过程,为空值占位符配置角色。

2
  1. 运行命令以检索后续步骤所需的atlasAWSAccountArn 。

    kubectl get atlasprojects my-project -o=jsonpath='{.status.cloudProviderIntegrations.atlasAWSAccountArn.type}'
    arn:aws:iam::198765432109:root
  2. 运行命令以检索后续步骤所需的atlasAssumedRoleExternalId 。

    kubectl get atlasprojects my-project -o=jsonpath='{.status.cloudProviderIntegrations.atlasAssumedRoleExternalId.type}'
    1a234b56-c789-0d12-345e-67f89012345a
3

您可以使用现有IAM角色,也可以创建新的IAM角色以实现统一访问。

使用以下自定义信任策略修改Amazon Web Services IAM角色的信任策略。将突出显示的行替换为您在上一步中检索到的值。

{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"AWS":"<atlasAWSAccountArn>"
},
"Action":"sts:AssumeRole",
"Condition":{
"StringEquals":{
"sts:ExternalId":"<atlasAssumedRoleExternalId>"
}
}
}
]
}
4

在 AWS 管理控制台的 Roles 部分,单击您为Atlas访问权限编辑或创建的 IAM角色。 AWS 在 Summary 部分显示 ARN。

5

替换 spec.cloudProviderIntegrations.iamAssumedRoleArn 中的空值占位符具有上一个步骤中 IAM 角色的 AWSAtlasProject ARN 的 自定义资源 的参数。

示例:

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test Project
projectIpAccessList:
- ipAddress: "192.0.2.15"
comment: "IP address for Application"
cloudProviderIntegrations:
- providerName: "AWS"
iamAssumedRoleArn: "arn:aws:iam::123456789012:role/aws-service-role/support.amazonaws.com/myRole"
EOF
6
  1. 运行命令以检索状态:

    kubectl get atlasprojects my-project -o=jsonpath='{.status.cloudProviderIntegrations}'
  2. 检查READY状态。

    • 如果状态为CREATED ,则 Atlas 创建了该角色,但您尚未在Amazon Web Services中授权。

    • 如果状态为EMPTY_ARN ,则 Atlas 创建了角色,但您尚未指定spec.cloudProviderIntegrations.iamAssumedRoleArn 。

    • 如果状态为READY ,则 Atlas 已创建角色,并且您已在Amazon Web Services中对其进行授权。

给本页内容打分

在此页面上