簡體   English   中英

Boto3 組織列出組織內的所有活動帳戶

[英]Boto3 Organizations list all active accounts within an Org

作為標題 state 我正在嘗試列出 aws 組織中的所有活動帳戶,同時還使用以下 python 和 boto3 調用對我的帳戶列表進行分頁。

client = boto3.client(
    "organizations",
    aws_access_key_id=credentials["AccessKeyId"],
    aws_secret_access_key=credentials["SecretAccessKey"],
    aws_session_token=credentials["SessionToken"],
)
paginator = client.get_paginator('list_accounts')
response_iterator = paginator.paginate(
PaginationConfig={
    'MaxItems': 1000,
    'PageSize': 123,
    'StartingToken': 'string'})
for page in response_iterator:        
    for acct in page['Accounts']:
        print(acct)

StartingToken 是從 AWS 接收的令牌。 看來您正在添加“字符串”

請參閱: 如何使用 Boto3 分頁

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM