MLA-C01 Practice Question 97: CDK Infrastructure as Code
AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 10 · question 7 of 10
An ML platform team deploys 20 models, each needing a similar SageMaker AI model, endpoint configuration, endpoint, IAM role, and auto scaling setup. The team's engineers write TypeScript, and they want to define this infrastructure in that language, using loops, classes, and reusable components, with unit tests, while still deploying through AWS CloudFormation stacks.
Which tool should the team use?
Show answer and explanation
Answer:
The AWS CDK is an open-source framework for defining cloud infrastructure in a general-purpose programming language, including TypeScript, and deploying it through AWS CloudFormation. Its building blocks are *constructs*, reusable modular pieces of code. The team can write one construct for a model's endpoint, role, and scaling setup, create it 20 times in a loop, and unit test it like any other TypeScript code (option C).
- A is wrong because YAML is not a programming language. Nested stacks split templates up, but they offer no loops, classes, or unit tests in TypeScript, and 20 similar models means a great deal of repeated configuration. - B is wrong because AWS SAM is a template extension focused on serverless applications such as Lambda functions and APIs. It is still declarative YAML or JSON, not TypeScript code. - D is wrong because Service Catalog lets users launch pre-approved products from a portfolio. It controls who can provision what, not how engineers write reusable infrastructure code.
Reference: What is the AWS CDK?