如何在 aws-cdk 堆栈中调用 !Ref 函数?我有一个带有 userPoolId 属性的 UserPool 资源和 UserPoolClientResource:
const userPool = new cognito.cloudformation.UserPoolResource(this, userPoolResourceName, {
userPoolName,
usernameAttributes: ['email'],
autoVerifiedAttributes: ['email'],
policies: {
passwordPolicy: {
minimumLength: 8,
requireLowercase: false,
requireNumbers: false,
requireSymbols: false,
requireUppercase: false
}
}
});
new cognito.cloudformation.UserPoolClientResource(this, userPoolClientResourceName, {
userPoolId: `!Ref ${userPool.id}`, // failed
clientName: userPoolClientName
});