是在IAM请求中增加pathPrefix参数,并将其添加到AWS SDK配置中。代码示例如下:
import boto3
from botocore.config import Config
config = Config(
signature_version='v4',
region_name='us-east-1',
# 设置pathPrefix参数
path_prefix='/my-path-prefix'
)
client = boto3.client('iam', config=config)
# 调用ListGroup方法
response = client.list_groups()