如何在AWS lambda

时间:2017-04-12 03:43:52

标签: python-2.7 aws-lambda

我在亚马逊中使用lambda函数。有没有办法从lambda函数中的python代码获取链接到AWS账户的电子邮件ID。

1 个答案:

答案 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账户。

请参阅:AWS Organizations Documentation