Answer - A
This is mentioned in the AWS Documentation.
AWS CloudFormation is a service that helps you model and set up your AWS resources using templates. An AWS CloudFormation template is a text file whose format complies with the JSON standard. You create a template that describes all of the AWS resources you want, and AWS CloudFormation takes care of provisioning and configuring those resources for you.
Option B is incorrect because Cloudwatch is a monitoring service and does not help to automate the deployment.
Option C is incorrect because Elastic Beanstalk cannot automate the deployment for the CodeDeploy service.
Option D is incorrect because AWS Config is not a service to automate the deployments.
For more information on using Cloudformation templates for CodeDeploy, please refer to the below URL-
https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-cloudformation-templates.html