Python3 と boto3 を使用して、AWS Config の集約された検出されたリソースを取得できません。
Python=3.7 Boto3=1.9.42 AWS SAM を使用して Lambda 関数をローカルでテストしていますが、AWS 内で Lambda を実行すると同じ問題が発生します。
client = master_session.client('config', region_name=my_region)
response = client.list_aggregate_discovered_resources(
ConfigurationAggregatorName=aggregator,
ResourceType="AWS::EC2::Instance")
エラーを返します:
{
"errorType": "AttributeError",
"errorMessage": "'ConfigService' object has no attribute 'list_aggregate_discovered_resources'",
"stackTrace": [
" File \"/var/task/app.py\", line 41, in lambda_handler\n r = client.list_aggregate_discovered_resources(\n",
" File \"/var/runtime/botocore/client.py\", line 563, in __getattr__\n self.__class__.__name__, item)\n"
]
}
ただし、このクライアントを使用して他のリクエストを実行できます。
これは機能します:
response = client.describe_configuration_aggregators()
print("Response: {}".format(response))