A company is migrating a multi-tier web application to AWS and wants to use Infrastructure as Code (IaC) to automate provisioning. Which AWS services can the company use to define and manage infrastructure declaratively? (Choose TWO.)
AWS CloudFormation defines infrastructure declaratively through JSON or YAML templates, letting the company version, review and provision the multi-tier stack repeatably. It satisfies the IaC requirement by managing resource creation and dependencies as code rather than manual console actions.
Why this answer
AWS CloudFormation (B) is correct because it lets you define infrastructure declaratively in JSON or YAML templates, and CloudFormation provisions and manages those resources as stacks. AWS Cloud Development Kit (CDK) (D) is also correct because it allows infrastructure to be defined declaratively using familiar programming languages, which then synthesizes into CloudFormation templates for deployment. AWS Elastic Beanstalk (A) is not the best fit because it is a PaaS that deploys applications from code or configuration but does not itself provide a general declarative IaC language for defining arbitrary infrastructure.
AWS OpsWorks (C) uses Chef/Puppet for configuration management and is more procedural/imperative in practice, not a declarative IaC service in the CloudFormation/CDK sense. AWS CodeDeploy (E) is a deployment orchestration service for applications, not an infrastructure definition or provisioning service.