您可以创建包含多个堆栈的AWS Cloud Development Kit (AWS CDK) 应用程序。部署 AWS CDK 应用程序时,每个堆栈都会变成自己的 AWS CloudFormation 模板。您也可以使用 AWS CDK CLIcdk deploy命令单独合成和部署每个堆栈。 在此示例中,我们将介绍以下内容:
is synthesized to its own AWS CloudFormation template, which is uploaded to the AWS CDK staging bucket at deployment. Nested stacks are bound to their parent stack and are not treated as independent deployment artifacts; they are not listed bycdk listnor can they be deployed bycdk deploy. ...
$cdk deploy'**'--outputs-file"/Users/code/myproject/outputs.json" Exampleoutputs.jsonafter deployment of multiple stacks {"MyStack": {"FunctionArn":"arn:aws:lambda:us-east-1:123456789012:function:MyStack-fn5FF616E3-G632ITHSP5HK"},"AnotherStack": {"VPCId":"vpc-z0mg270fee16693f"} } ...
npx aws-cdk deploy After the deployment has succeeded we have provisioned the following stacks:If we look at the ec2-stack, we see that it only provisions 6 resources. One of them, being the nested VPC stack:The resource of type AWS::CloudFormation::Stack is our nested stack, which pr...
Most people have careful, considered deployment strategies. Like you, the speaker has no time for that. Here's an automated pipeline that deploys an application toeveryAWS region simultaneously, while throwing caution (as well as user experience) to the wind. ...
When deploying multiple stacks with different parameter values, we have to prefix the parameter name with the stack name. shell npx aws-cdk deploy my-stack-dev my-stack-prod \ --parameters my-stack-dev:tableName=devTable \ --parameters my-stack-prod:tableName=prodTable For our project, ...
Also, we saw how you can use the AWS CDK toolkit to interact with the CDK app. The toolkit allows you to synthesize the stacks to the AWS CloudFormation template and to deploy it to an AWS account. The complete source code of the sample CDK application that was used in this article can...
The same happens if you add a new stack toCdkpipelinesDemoStage:the pipeline automatically updates itself to deploy this new stack to all stages, and if there are dependencies between the stacks, it automatically deploys them in the right order. You don’t do that in this tutorial, but fee...
Deploy the stacks that depend on the initial scaffolding stack. Encounter error. Versions language: typescript cdktf-cli: 0.15.5 node: v18.16.0 cdktf: 0.17.0 constructs: 10.2.61 jsii: null terraform: 1.4.5 arch: x64 os: linux 5.10.16.3-microsoft-standard-WSL2 ...
In this project, I usedDashbirdfor its ease of use and seamless integration. Instead of having to deploy an agent inside my code, Dashbird plugs into my Stacksthrough a CloudFormation templatethat I can deploy with the effort of one click. It not only monitors Lambda functi...