An administrator manually opened a port on a cloud security group in the console. The team must detect the deviation from its declared infrastructure and restore the intended configuration. Which approach BEST does this?
Show the answer
Correct answerD. Compare Terraform's recorded state with the live resources, then apply
AWhy not this: Ansible manages configuration inside hosts and does not reconcile cloud security group rules against a declared state.
BWhy not this: Image scanning looks for vulnerabilities in container images and says nothing about security group rules.
CWhy not this: A CASB finds unsanctioned SaaS use and does not reconcile infrastructure against its declared definition.
DWhy this is right: Terraform plan shows drift between declared code and real resources, and apply restores the intended configuration.
Terraform keeps a state of the declared infrastructure, so a plan exposes drift between code and live resources and an apply reconciles it. Ansible configures operating systems and software on hosts, so it does not track or restore cloud resources such as security groups.