我正在尝试使用 AWS doc创建“ CfnUserPoolClient ”对象 - https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_cognito/CfnUserPoolClient.html
我已经创建了这样的“ CfnUserPool ”对象 -
_cognito_user_pool = _cognito.CfnUserPool(stack, id="pool-id", user_pool_name="user-auth-pool")
要创建“ CfnUserPoolClient ”对象,我需要“ CfnUserPool ”对象的 ID。我正在使用下面的代码来创建“ CfnUserPoolClient ”对象-
_user_pool_id = _cognito_user_pool.user_pool_id
_cognito_userpool_clients = _cognito.CfnUserPoolClient(stack, id="client-id", user_pool_id=_user_pool_id, client_name="client-name")
我收到以下代码的错误 -
AttributeError: 'CfnUserPool' object has no attribute 'user_pool_id'.
我认为“CfnUserPool”对象没有属性“user_pool_id”。我已经尝试过“id”来获取这样的用户池 id -
_user_pool_id = _cognito_user_pool.id
但我仍然遇到同样的错误,这次是“id”。
那么如何从 CfnUserPool 资源中获取 CfnUserPoolClient 的“user_pool_id”值?