我在亚马逊中使用lambda函数。有没有办法从lambda函数中的python代码获取链接到AWS账户的电子邮件ID。
答案 0 :(得分:1)
describe-organization
中的AWS Command-Line Interface (CLI)命令会返回此信息:
aws organizations describe-organization
输出:
{
"Organization": {
"MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111",
"MasterAccountEmail": "bill@example.com",
"MasterAccountId": "111111111111",
"Id": "o-exampleorgid",
"FeatureSet": "ALL",
"Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid",
"AvailablePolicyTypes": [
{
"Status": "ENABLED",
"Type": "SERVICE_CONTROL_POLICY"
]
}
}
AWS Organizations 是introduced in early 2017,用于管理层次结构中的多个AWS账户。