【发布时间】:2021-08-14 15:24:35
【问题描述】:
我的 cdk 应用程序中有两个嵌套堆栈。
export default class mainAppStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new NestedStackOne(this, "nested-one");
new nestedStackTwo(this, 'nested-two);
}
}
export class nestedStackOne extends cdk.NestedStack {
constructor( scope: cdk.Construct, id: string, props?: cdk.NestedStackProps ) {
super(scope, id, props);
new new cognito.UserPool(this, `Userpool`, {
// ...configs
});
});
}
export class nestedStackTwo extends cdk.NestedStack {
constructor( scope: cdk.Construct, id: string, props?: cdk.NestedStackProps
) {
super(scope, id, props);
});
}
我想将嵌套堆栈一中定义的用户池的 arn 传递给堆栈二。我一直在努力寻找一种方法来做到这一点。 AWS 文档没有帮助。我该怎么做呢?如何在嵌套堆栈之间引用。
【问题讨论】:
标签: typescript amazon-web-services aws-cdk