AWS · Advanced Networking Specialty

网络课程笔记

Lecture 253 · 8 张幻灯片

幻灯片、双语总结及 Transcript · 图片已内嵌,可离线阅读。

原文默认收起
lecture-253.md

Lecture 253: AWS CloudFormation

  • 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
  • 视频时长:14:52
  • 来源:Udemy Lecture 33789824
  • Slide 数量:8
  • 画面切换:02:14、04:28、05:56、08:01、09:27、10:47、12:58

扫描说明

逐条读取了 Transcript 面板中的 368 条英文 cue,并按播放器进度同步全长约 14:52 的视频。依据 Infrastructure as Code、Benefits、Template、Change Set/StackSets、Cross/Nested Stack、DependsOn、WaitCondition 与 CDK 划分为 8 个小节。8 张截图来自真实课程 Slide,统一为 1364×770。讲师把 Stack Policy 解释为可在删除 Stack 时保留数据库;这并不准确,讲义已明确区分 Stack Policy 与 DeletionPolicy/UpdateReplacePolicy。

Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。

1. CloudFormation 用 Declarative Template 重建可重复的 AWS Infrastructure

时间范围:00:00–02:14

Infrastructure as code slide describing reproducible AWS infrastructure

总结 / Summary

中文

AWS CloudFormation 是 AWS 原生 Infrastructure as Code 服务:Template 声明 Desired State,CloudFormation 建立依赖图并通过 Stack 创建、更新或删除资源。相同 Template 可在不同 Account/Region 以不同 Parameter 部署,用于一致的 VPC、Subnet、Route、Security Group、VPN 等网络基础设施。它减少 Console Click 与手工漂移,但并不自动保证架构正确;Template、Parameter、IAM Permission 与 Region-specific Value 仍需设计和测试。

English

AWS CloudFormation is AWS's native infrastructure-as-code service. A template declares desired state, and CloudFormation builds a dependency graph and creates, updates, or deletes resources through a stack. The same template can be deployed with different parameters across accounts and regions for consistent VPCs, subnets, routes, security groups, VPNs, and other network infrastructure. It reduces console clicks and manual drift, but it does not guarantee a correct architecture; templates, parameters, IAM permissions, and region-specific values still require design and testing.

Transcript

00:00 Hello, and welcome to this lecture, AWS CloudFormation.

00:03 So, as I said, from the management services,

00:06 we'll be looking at few services here,

00:08 and we are talking about AWS CloudFormation,

00:10 because we have seen some question,

00:13 one or two times maybe around AWS CloudFormation.

00:17 So, first of all,

00:18 let's understand what is AWS CloudFormation service.

00:20 You can say, it is infrastructure as a code service.

00:24 So, instead of manually creating everything,

00:27 you can just write a code for that.

00:30 So, if you're doing a lot of manual work

00:33 for creating AWS infrastructure,

00:35 like creating VPCs, and the Subnets, and the VPN connection,

00:39 it is no more required.

00:41 And if you're working in AWS,

00:42 I'm sure, you know AWS CloudFormation,

00:44 because it's pretty much, very powerful service in AWS.

00:49 And then, you can always create these resources

00:53 interpretable manner in different AWS region.

00:56 Maybe for day one test purpose,

00:57 You are launching your resources in US, East one region,

01:01 because cost is relatively lower there, but for production,

01:05 you want to launch it in, maybe Singapore region.

01:08 Then you can use the same CloudFormation template,

01:10 and just deploy it in Singapore, right?

01:13 So, you can deploy same resources in another region,

01:17 another AWS account.

01:19 And, even if within the same region,

01:22 if everything was deleted accidentally,

01:22 you can recreate that using the CloudFormation.

01:27 So, wouldn't it to be great?

01:28 If you could do that as a code, of course, it'll be great.

01:32 And that's where, it's AWS CloudFormation service,

01:34 that helps you with.

01:36 So, it's a declarative way of

01:37 outlining your AWS infrastructure for any resources.

01:41 Now, when we say any resources,

01:43 typically what I have seen is,

01:44 whenever AWS launches new AWS services,

01:47 they will also have a support for that service

01:50 in AWS CloudFormation.

01:52 And if you compare this with, maybe a third party tools,

01:55 for example, you know, Terraform, you know, Ansible.

01:58 So, these are not native to AWS, right?

02:01 And in that case, I think it will take some longer time for,

02:04 you know, resources support to be available in those tools.

02:08 So yeah, most of the AWS resources are supported

02:11 in AWS CloudFormation as of today.

2. IaC 的价值是 Version Control、Review、Repeatability 与 Lifecycle Automation

时间范围:02:14–04:28

Benefits of AWS CloudFormation including version control and reviewed infrastructure changes

总结 / Summary

中文

Template 可进入 Git 做 Version Control、Pull Request Review 与 Audit,环境可重复创建,资源依赖与失败回滚由 Stack Lifecycle 协调。开发环境可以通过删除 Stack 自动回收大批资源,但删除行为受 DeletionPolicy、Service Constraint 与外部依赖影响,并不等于无条件删除全部资源。成本也来自 Template 创建的实际 AWS Resource;CloudFormation 本身及 Extension、Third-party Resource 或额外服务的收费应以当前 Pricing 为准。

English

Templates can be version-controlled in Git, reviewed through pull requests, and audited. Environments become repeatable, while stack lifecycle coordinates dependencies and failure rollback. A development environment can remove many resources by deleting its stack, but deletion is affected by deletion policies, service constraints, and external dependencies; it does not unconditionally remove everything. Cost comes from the AWS resources a template creates, and any CloudFormation, extension, third-party resource, or related-service charges should be checked against current pricing.

Transcript

02:14 Now, why would you use AWS CloudFormation?

02:17 Maybe you want to create everything, right?

02:19 VPC, Subnets, internet gateways, security groups.

02:22 So, we have been doing a lot of exercises, right?

02:25 In this course,

02:26 and you know that we are creating all this one by one,

02:29 sequentially, manually,

02:31 and it takes certain amount of time.

02:33 So, of course, we would want

02:36 to use AWS CloudFormation instead,

02:38 because it creates your resources in right order.

02:42 Because for example, if you're creating EC2, it knows that,

02:45 it has to first create a subnet,

02:47 and before subnet, it has to first create VPC.

02:49 So, all these dependencies typically managed

02:52 by AWS CloudFormation internally.

02:54 You don't have to really worry a lot,

02:57 but there have been cases where you need to manage

02:59 the dependency and we'll talk about that.

03:01 But then it creates those resources in the right order.

03:05 So, what are the benefits of CloudFormation,

03:07 of course, infrastructure as a code,

03:09 no resources created manually.

03:11 That means no manual errors,

03:13 code can be controlled using the git kind of repository.

03:17 So, it's source controlled.

03:18 That means you could also see or track the changes happening

03:21 to your infrastructure through the code, right?

03:24 So, if somebody changes your template,

03:26 which has been added to git repository,

03:28 you can review,

03:29 what changes have been made to your infrastructure,

03:31 just looking at that template change.

03:34 So, it is reviewable.

03:36 Cost. You could also get

03:38 a cost for per CloudFormation template,

03:41 ultimately templates create resources.

03:43 So, what's the total cost of all those resources

03:45 inside my AWS CloudFormation template,

03:48 that cost you can get.

03:49 Because CloudFormation adds automatically attached

03:51 to every resource it creates.

03:54 That means you could also, you know,

03:55 estimate how much this CloudFormation template will cost,

04:00 if somebody deploys that.

04:02 Further, you could also have a saving strategy,

04:04 for example, in development environment,

04:07 you want to delete everything at 5:00 PM,

04:10 because it's a development,

04:11 and you don't want those resources to be running

04:14 throughout the night.

04:15 So, you could have this kind of automation set,

04:17 because you created your all resources using CloudFormation,

04:20 and you can make one API call to delete

04:23 the CloudFormation stack that it created.

04:25 And then, you are saving a lot of cost there.

3. Template 用 JSON/YAML 描述 Logical Resource、Type、Property 与 Reference

时间范围:04:28–05:56

CloudFormation template example for an AWS EC2 VPC peering connection

总结 / Summary

中文

核心 Resources Section 为每个 Logical ID 指定 Type 与 Properties;示例以 AWS::EC2::VPCPeeringConnection 连接两个 VPC。真实 Template 还常用 Parameters、Mappings、Conditions、Outputs、Ref、Fn::GetAtt 与 Fn::Sub,把 Account/Region 差异参数化。CloudFormation Resource Specification/Registry 定义可用 Property 与 Update Behavior;不是所有字段都必填,也不是所有更新都 In-place,某些变更会 Replacement,因此更新前要阅读当前资源文档。

English

The core Resources section gives each logical ID a type and properties; the example uses AWS::EC2::VPCPeeringConnection to connect two VPCs. Real templates also commonly use Parameters, Mappings, Conditions, Outputs, Ref, Fn::GetAtt, and Fn::Sub to parameterize account and region differences. The CloudFormation resource specification and registry define available properties and update behavior. Not every property is required, and not every update is in place; some changes cause replacement, so check the current resource documentation before updating.

Transcript

04:28 So, how does it work?

04:29 So, it's very simple.

04:31 You write a template.

04:32 Template could be JSON and YAML,

04:34 and you just store that template in S3 bucket,

04:37 or you can even have it on your machine.

04:39 You upload that in that case.

04:41 And then, CloudFormation will create all the resources,

04:44 which are part of that template.

04:46 So, this is a simple template

04:47 for VPC peering in the same account.

04:50 So, this is a type of the resource.

04:53 You define it.

04:54 And there is a documentation in AWS,

04:56 which tells you what the resource name is,

04:58 and what are the properties of the resources are.

05:00 So, here we say, VPC ID is a current VPC,

05:04 which is making and request for other VPC to peer.

05:09 And then, there will be peer VPC ID.

05:11 So, after you deploy that in a CloudFormation,

05:13 there will be a VPC peering,

05:15 between this VPC and other remote VPC, basically.

05:20 Now, this is in the same AWS account,

05:22 but that could be another AWS account as well.

05:25 And in that case, you add additional parameters here,

05:28 who is the owner of that account?

05:30 What is the rule that the other account will be using?

05:33 What tags I need to add?

05:34 So, not all the properties are mandatory.

05:38 Most of the properties are optional, as you can see here,

05:42 but then, depending on what resources you create,

05:45 there will be different properties.

05:46 The best way to really check is to go to AWS documentation

05:50 for CloudFormation and look at all those properties.

05:53 So, this is just one example out there.

4. Change Set 预览更新,StackSets 扩展到多账号/多 Region;Stack Policy 只保护 Update

时间范围:05:56–08:01

CloudFormation features including Designer Change Sets and StackSets

总结 / Summary

中文

Change Set 在执行前显示 Add/Modify/Remove、Replacement 等预期变更,但它不是成功保证,也不能发现所有运行时影响。StackSets 把同一 Template 作为 Stack Instance 分发到多个 Account/Region,可使用 Self-managed 或 Organizations Service-managed Permission Model。最重要的纠错:Stack Policy 控制 Stack Update 时哪些资源不可被修改或替换,并不能阻止 Delete Stack 删除资源。若数据库在 Stack 删除或替换时必须保留,应使用 DeletionPolicy: Retain/Snapshot,并按需要配合 UpdateReplacePolicy。

English

A change set previews expected additions, modifications, removals, and replacements before execution, but it is not a guarantee of success and cannot expose every runtime impact. StackSets distributes one template as stack instances across accounts and regions using self-managed or Organizations service-managed permissions. Crucially, a stack policy protects resources from update actions; it does not prevent DeleteStack from deleting them. To preserve a database when a stack is deleted or a resource is replaced, use DeletionPolicy: Retain or Snapshot and, where needed, UpdateReplacePolicy.

Transcript

05:56 Now, some feature and components of CloudFormation,

05:59 which are again important to know.

06:01 CloudFormation Designer.

06:02 As I said, you can provide the template,

06:05 and CloudFormation can show you the diagrams on.

06:09 You can also basically create those diagrams,

06:11 and automatically it will create

06:13 the CloudFormation template for you.

06:15 ChangeSets, what it means is,

06:18 if you have one CloudFormation template already developed,

06:21 and then you deployed a stack using that CloudFormation.

06:23 Now, you want to change something.

06:25 Maybe you want to add one more security group rule,

06:28 for example, right?

06:30 In that case,

06:31 before making changes to your live environment,

06:34 you want to make sure that you understand

06:36 what changes your template is going to make

06:38 to your environment.

06:40 So in that case, you create a ChangeSet.

06:42 Then it'll tell you that

06:43 it's going to add a new security group, is that okay?

06:46 Then you review it, and then you go,

06:49 and apply those changes.

06:50 So, this is like a pre step before you apply new changes,

06:55 or you update the template, right?

06:56 Before that you can look at this ChangeSets.

06:59 StackSets.

07:00 Now, if it's a same stack,

07:02 and you want to deploy it across multiple AWS account,

07:05 or multiple regions.

07:07 Maybe you are a SAS provider and you want to deploy,

07:10 you know, per customer one stack,

07:12 exactly same stack in different regions or accounts.

07:15 Then you can use StackSets.

07:16 So, you don't have to repeat those things for every account,

07:19 rather StackSets will take care of that.

07:22 Stack Policies.

07:23 Again, important one.

07:24 Maybe you are creating CloudFormation stack

07:26 with a lot of resources,

07:28 and you want ability to delete those resources.

07:30 You will just go and delete the CloudFormation stack.

07:32 But if you're using say a database, right? RDS.

07:36 And you don't want database to be deleted,

07:38 because there is a lot of data in there,

07:41 and that's valuable to you.

07:42 Even if you are deleting the environment,

07:42 you want to reuse that data somewhere.

07:46 Or maybe if you're launching again an application,

07:48 you want to use the same database.

07:50 So, you could provide a Stack Policies, which says,

07:53 don't delete this particular resource,

07:55 delete everything else, but don't delete this.

07:58 So, all that can be done using Stack Policies.

5. Cross-stack Reference 共享独立 Lifecycle;Nested Stack 复用 Parent-owned Component

时间范围:08:01–09:27

CloudFormation cross stacks and nested stacks comparison

总结 / Summary

中文

Cross-stack Reference 通过 Output Export 与 Fn::ImportValue,让独立 Stack 共享 VPC ID、Subnet ID 等值;它们有不同 Lifecycle,且 Import/Export 有 Region 与更新约束。Nested Stack 使用 AWS::CloudFormation::Stack 把复用 Template 作为 Parent Stack 的 Resource,适合把 RDS、ALB、ASG 等标准组件组合成更大 Stack;Child 的生命周期受 Parent 管理。选择依据是 Ownership:需要独立部署/共享时用 Cross-stack,需要父级统一编排与组件化时用 Nested Stack。

English

Cross-stack references use output exports and Fn::ImportValue so independent stacks can share values such as VPC and subnet IDs. They retain separate lifecycles and have regional and update constraints around imports and exports. A nested stack uses AWS::CloudFormation::Stack to make a reusable template a resource of a parent stack, which is useful for composing standardized RDS, ALB, or Auto Scaling components into a larger stack; the child lifecycle is managed by the parent. Choose based on ownership: independent deployment and sharing favor cross-stack references, while parent-controlled composition favors nested stacks.

Transcript

08:01 Few more, Cross Stacks.

08:03 So, Cross Stacks are something like, you know,

08:05 you have a base, stack basically.

08:07 So this is more, you know, programming kind of thing.

08:10 Every other stack uses the same base stack.

08:13 For example, you're creating one VPC.

08:15 And in that one VPC,

08:16 you want to launch multiple applications.

08:18 Now, instead of every application launching their own VPC,

08:21 you use one VPC stack.

08:24 As a separate stack, it'll just launch that VPC,

08:26 and required subnets.

08:28 And then, all the other stack will use the same VPC.

08:32 So, they can refer the resources in the centralized,

08:36 or base stack into their stack, basically.

08:40 So, that is a Cross Stacks.

08:41 And then, Nested Stacks.

08:43 It's more about,

08:44 you can reuse your existing stack.

08:47 So, instead of creating the RDS database,

08:50 or including the code for RDS database

08:52 into every CloudFormation template,

08:55 you just wrap it into one separate CloudFormation template.

08:59 And then, you could have one big CloudFormation template,

09:02 which just refers to other template.

09:04 So, you are not rewriting the code, basically.

09:06 You are reusing your other CloudFormation templates,

09:10 which you have already written.

09:12 So, it also provides you some kind of standardization.

09:15 You want to make sure the DBAs write this RDS stack,

09:18 and nobody changes that, right?

09:20 So, you just refer to those stack

09:22 for creating the database rather than writing your own code.

6. Implicit Dependency 优先;DependsOn 只在 CloudFormation 无法推断顺序时显式声明

时间范围:09:27–10:47

CloudFormation resource dependencies using the DependsOn attribute for VPN route propagation

总结 / Summary

中文

Ref、GetAtt、Sub 等引用会形成 Implicit Dependency,CloudFormation 据此并行或按序创建资源。只有关系无法从引用推断,或必须在另一个资源完成后执行特定动作时,才使用 DependsOn。课程例子是 AWS::EC2::VPNGatewayRoutePropagation 必须等待 VPN Gateway Attachment 完成。DependsOn 只等待 CloudFormation Resource 达到其完成状态,不代表 EC2 内的 Application Bootstrap 已经 Ready。

English

References through Ref, GetAtt, or Sub create implicit dependencies, which CloudFormation uses to parallelize or order resource creation. Use DependsOn only when the relationship cannot be inferred from references or when an action must follow another resource's completion. The lecture example makes AWS::EC2::VPNGatewayRoutePropagation wait for the VPN gateway attachment. DependsOn waits for the CloudFormation resource's completion state; it does not prove that application bootstrap inside an EC2 instance is ready.

Transcript

09:27 Okay. Moving on.

09:28 Many a times,

09:29 it happens like in CloudFormation, you write a template,

09:32 and then you want to make sure,

09:33 before creating one of the resource,

09:36 some other resource should be created.

09:38 Now, most of the time AWS manages that,

09:40 but there are certain scenarios where AWS can't decide,

09:45 whether you want to create resource first,

09:48 and then add the entry somewhere,

09:49 because it's all, not directly related.

09:53 For example,

09:54 if you want to create a VPN gateway in your architecture,

09:59 and you also want to add a route table entry

10:02 for that VPN gateway for route propagation.

10:05 Now, if you want to really enable that route propagation,

10:07 first the VPN gateway has to be created.

10:10 Now, CloudFormation natively you cannot manage that,

10:13 but then CloudFormation provides you some levers,

10:15 like for example,

10:17 there is something called DependOn as an Attribute.

10:20 Now, what it does is,

10:21 you can say,

10:22 before creating the route table propagation,

10:25 it DependsOn the VPN gateway resource.

10:29 So, what CloudFormation will do it,

10:32 before creating this root propagation,

10:33 it'll wait for your VPN gateway attachment to happen.

10:37 And then only, it will enable that route propagation.

10:41 So, this kind of conditions,

10:42 helps you really manage the dependencies

10:45 of the AWS resources.

7. WaitCondition 用 Signal/Timeout 协调 Stack 外部动作;EC2 Bootstrap 常优先 CreationPolicy

时间范围:10:47–12:58

CloudFormation WaitCondition coordinating resource creation with external configuration actions

总结 / Summary

中文

WaitCondition 与 WaitConditionHandle 提供 Presigned URL,外部流程发送 Success/Failure Signal,Stack 在收到所需信号或 Timeout 前保持等待,适合 CloudFormation 无法直接观察的外部协调。对于 EC2/Auto Scaling Bootstrap,AWS 文档通常建议优先在 Resource 上使用 CreationPolicy 并由 cfn-signal 回报,因为它把等待语义附着在资源本身。无论哪种方式,都要设置合理 Timeout、失败路径与网络访问,避免 Stack 永久卡住或错误继续。

English

WaitCondition and WaitConditionHandle provide a presigned URL to which an external process sends success or failure signals. The stack waits for the required count or a timeout, which is useful for coordination CloudFormation cannot observe directly. For EC2 and Auto Scaling bootstrap, AWS documentation generally recommends a resource CreationPolicy with cfn-signal because the readiness contract is attached to the resource itself. In either approach, define a reasonable timeout, failure path, and network access so a stack neither stalls indefinitely nor proceeds incorrectly.

Transcript

10:47 Now, there is one more such condition like DependsOn,

10:50 which is WaitCondition.

10:51 Now, WaitCondition is interesting.

10:54 Many a times, you would want that,

10:56 you launch EC2 machine.

10:57 And also in that EC2 machine,

10:59 you would want to install some applications.

11:03 Now, AWS won't know, what kind of application

11:09 you're installing in EC2 machine.

11:09 Maybe you're using user data of the EC2 to, you know,

11:10 download some packages, and install.

11:13 And before you move to the next resources

11:15 to be created through CloudFormation, you want to wait.

11:17 Because maybe then, EC2 also making a call to a database,

11:21 or there is some dependencies between, you know,

11:24 all these things.

11:25 So, what you can do is,

11:26 you can create a WaitCondition,

11:28 and then, through your EC2 user data,

11:30 you install everything,

11:31 and you can send signal to the WaitCondition.

11:34 And then, WaitCondition moves forward.

11:36 Otherwise it'll wait for the maximum time amount period,

11:39 that you have defined.

11:40 So, you can give your EC2 machine,

11:42 to have maybe 10 minutes of, you know,

11:44 boot strap time, right?

11:46 If you put that under the WaitCondition.

11:49 Now, without WaitCondition, what would happen?

11:51 CloudFormation will create EC2 instance.

11:53 So, as soon as EC2 instances up and running,

11:55 CloudFormation thinks that, yeah, it is done, right?

11:57 Let's move to the next resources to be created,

12:00 or other parallel resources to be created.

12:02 But if there is some kind of dependencies,

12:04 then it can't handle that.

12:06 In that case, you would have to use WaitCondition.

12:09 Now, we are not using DependsOn clause here,

12:11 because again,

12:12 DependsOn just looks at the AWS resource creation.

12:12 It doesn't really wait for EC2 to be become active,

12:12 which only, you know,

12:12 when the EC2 installs all the scripts inside

12:20 within the user data, right?

12:25 So, you have to externally make a signal

12:27 to the WaitCondition,

12:28 and there is a way to do that, right?

12:31 It gives you one URL,

12:32 you send a signal to that URL,

12:35 which is S3 based URL,

12:36 which WaitCondition handler gives you.

12:39 And then, once that handler receives the signal as success,

12:42 then only, CloudFormation will proceed from there.

12:45 I know, little mercy here, but then,

12:49 if you're interested,

12:50 just read more about it through

12:52 CloudFormation documentation.

12:54 But then, DependsOn and WaitConditions are the two things,

12:56 we have seen,

12:57 coming into your exam.

8. AWS CDK 用 Programming Language 与 Construct 生成 CloudFormation Template

时间范围:12:58–14:52

AWS Cloud Development Kit source code synthesized into a CloudFormation template

总结 / Summary

中文

AWS Cloud Development Kit(CDK)让开发者用熟悉的 Programming Language 定义 Construct,再通过 cdk synth 生成 CloudFormation Template,cdk diff 预览变化,cdk deploy 创建或更新 Stack。L1 Construct 接近原始 CloudFormation Resource,L2/L3 Construct 提供更高层默认值与组合模式。CDK 并不绕过 CloudFormation:最终部署、Change Set、Rollback、IAM 与 Resource Lifecycle 仍由 CloudFormation 执行,因此调试时要同时理解 Construct Source 与 Synthesized Template。

English

AWS Cloud Development Kit lets developers define constructs in familiar programming languages, synthesize a CloudFormation template with cdk synth, preview changes with cdk diff, and create or update stacks with cdk deploy. L1 constructs closely mirror raw CloudFormation resources, while L2 and L3 constructs provide higher-level defaults and patterns. CDK does not bypass CloudFormation: deployment, change sets, rollback, IAM, and resource lifecycle are still executed by CloudFormation, so troubleshooting requires understanding both construct source and the synthesized template.

Transcript

12:58 Okay. So, that's about the CloudFormation basically.

13:01 And just, as I said,

13:02 there is an extension to the CloudFormation,

13:03 which is Cloud Development Kit.

13:05 Now, CloudFormation itself is a template,

13:07 which you write in a JSON or YAML format.

13:10 But if you want to really write a real code

13:13 using Java, or a TypeScript, or Python.

13:17 So, it will create then CloudFormation.

13:19 Now, that's really the powerful, right?

13:21 That means if you want to have some kind of,

13:23 loop structures, if else condition,

13:26 that is very difficult in CloudFormation,

13:28 but then, with AWS Cloud Development Kit, which is CDK,

13:33 you can write a code in these languages

13:35 to generate the CloudFormation template.

13:37 And then, you can deploy using the CDK CLI, basically.

13:41 So, you write your code,

13:43 you synthesize that code through CDK CLI,

13:45 which generates the template.

13:48 And then, you deploy that using the CloudFormation

13:50 to create the stack, basically.

13:52 So, that is CDK.

13:53 So, you can write a code in Java, Python, as I said.

13:56 So, this is the new way of doing the things.

13:59 And then, you can also create libraries.

14:01 It is called as CDK Construct.

14:03 So, you can share your Construct with other developers.

14:06 You could add that to your open source code, right?

14:10 So, all the developers can use your code,

14:12 and change it as required.

14:14 So, instead of really sharing the template,

14:16 you are now sharing the code,

14:18 which generates those templates.

14:20 And the process is like your cdk init,

14:22 which folks a project into your repository.

14:25 Then you build that, you synthesize that,

14:28 which creates the template.

14:30 If you are making an update to existing template,

14:32 you can also look at the cdk diff,

14:34 which is like a ChangeSets in CloudFormation.

14:36 And then you say cdk deploy.

14:38 So, ultimately same thing, but you know,

14:41 doing it more in programmatic way.

14:44 So, that's about CDK, and that's about the CloudFormation,

14:46 that you need to know for your exam.

14:48 I hope, most of the things are clear.

14:50 So, thanks for watching.

整讲总结 / Overall Summary

中文

CloudFormation 的考试重点是 Declarative Template/Stack、Implicit 与 Explicit Dependency、Change Set、StackSets、Cross-stack vs Nested Stack,以及 WaitCondition/CreationPolicy 的等待语义。尤其要记住:Stack Policy 只约束 Update,不保护 Delete Stack;资源保留要用 DeletionPolicy/UpdateReplacePolicy。CDK 是生成并部署 CloudFormation 的更高层编程模型,不是独立的 Provisioning Engine。

English

CloudFormation exam priorities are declarative templates and stacks, implicit versus explicit dependencies, change sets, StackSets, cross-stack versus nested stacks, and WaitCondition or CreationPolicy readiness semantics. Most importantly, a stack policy constrains updates and does not protect resources from stack deletion; preservation requires DeletionPolicy and UpdateReplacePolicy. CDK is a higher-level programming model that generates and deploys CloudFormation, not a separate provisioning engine.

返回顶部 ↑