如何在boto SDK中指定启用API网关的IAM角色的ARN将信息写入CloudWatch Logs?

How to specify the ARN of an IAM role that enables API Gateway to write information to CloudWatch Logs in boto SDK?

当您转到 API 网关页面上的设置并添加 IAM 角色 (https://console.aws.amazon.com/apigateway/home?region=us-east-1#/settings) 时,可以手动完成。但我不知道哪个 API 将它用于 python sdk。

可以使用 python sdk https://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.update_account

调用 update_account 来设置 CloudWatch 角色

cloudwatchArn 的路径是 /cloudwatchRoleArn