Cloud Development Kit Flashcards

1
Q

How can you use SAM CLI to test CDK apps?

A

Run cdk synth to generate your CloudFormation template from the code
-> Use sam invoke to run your template that was generated from the synth command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a CDK contruct?

A

A component that encapsulates everything CDK needs to create the final CF stack
-> Can represent one or more AWS resources (e.g., S3 bucket, worker queue with compute)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is CDK bootstrapping?

A

Provisioning resources for CDK before you deploy CDK apps into an environment
-> Run the command cdk bootstrap
-> Creates a CF Stack called CDKToolkit: contains an S3 bucket and IAM roles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you test CDK apps?

A

Using CDK Assertions Module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What types of testing are available for CDK apps?

A

Fine-grained assertions
-> Test specific aspects of the CF template (resource has a property with value X)
Snapshot Tests
-> Test the synthed CF template against a previously stored baseline template

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What methods do you have to import a template for CDK testing?

A

Template.fromStack(MyStack) - stack built in CDK
Template.fromString(mystring) - stack built outside CDK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly