所以我使用boto3连接AWS WorkMail。我使用了我的一个IAM用户,并向该用户授予了完整的WoekMail权限。我创建了一个组织,我想通过编程方式使用他们的API之一为它创建一个用户
因此,我的代码如下所示:
import boto3
from config import aws_credentials
client = boto3.client('workmail', **aws_credentials)
response = client.create_user(
OrganizationId="m-69a01**********************848eb",
Name='abhi',
DisplayName='abhi jain',
Password='********'
)
所以我不断地得到这个错误:
botocore.errorfactory.OrganizationNotFoundException: An error occurred (OrganizationNotFoundException) when calling the CreateUser operation: Could not find organization with id 'm-69a01**********************848eb'
只是为了确保我仔细检查了我的组织ID,并附上了一张截图。我不确定这是否是用于此API的正确组织ID
发现我的错误,aws凭据设置为
us-west-2
区域,而我的组织位于us-east-1
因此,由于我无法更改我的组织区域,我将
~/.aws/config
中的区域更改为与我的组织相同的区域,并使用了相同的代码,它工作起来很有魅力相关问题 更多 >
编程相关推荐