AWS CDK 部署:如果有多个堆栈,则需要参数
我的环境 Typescript、node.js、cdk。我尝试部署由两个堆栈组成的 AWS 堆栈:
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from "@aws-cdk/core";
import { WafRegionalStack } from '../lib/WafRegionalStack'
import { ReactStack } from '../lib/ReactStack';
const app = new cdk.App();
new WafRegionalStack(app, 'WafRegionalStack', {})
new ReactStack(app, 'ReactStack', {})
我使用命令:
npx deploy
执行此部署过程会出现错误
require argument if there is more than a single stack
My env Typescript, node.js, cdk. I try to deploy AWS stack that consists of two stacks:
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from "@aws-cdk/core";
import { WafRegionalStack } from '../lib/WafRegionalStack'
import { ReactStack } from '../lib/ReactStack';
const app = new cdk.App();
new WafRegionalStack(app, 'WafRegionalStack', {})
new ReactStack(app, 'ReactStack', {})
I use a command:
npx deploy
Doing this deployment process get a mistake
require argument if there is more than a single stack
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
https://docs.aws.amazon.com/cdk/v2/指定堆栈下的guide/cli.html是您如何一次部署特定或所有堆栈的方法。
具体地
或在您的具体情况下使用通配符
,您可以使用:
或
https://docs.aws.amazon.com/cdk/v2/guide/cli.html under Specify Stacks is how you can deploy specific or all stacks at once.
specifically
or with wildcards
in your specific situation, you can use:
or
如果应用程序中有多个堆栈,我们需要选择 CLI 命令:
If there is more than a single stack in the app we need to choose the CLI command: