To understand how CDK works, you have to understand the concepts of a CloudFormation Template, a CloudFormation Stack and an AWS Infrastructure Resource.
The code in this example is in the file hellocdk.go.
The template is a yaml or json file which describes an AWS Infrastructure Resource.
The AWS CloudFormation service provides API calls for interpreting several resources, which are bundled together in the template and create them together.
All the created resources from one template is called a Stack.
Examples for AWS resources are the SNS topic, an EC2 instance and a few hundreds more…
The cdk called with cdk deploy
generates a Template from the program and then sends it to the cloudformation service, which creates the stack.
The cdk destroy
call deletes the stack.
Now let’s see a walkthrough in the next chapter