Which statement correctly describes a key difference in how AWS CloudFormation and Terraform manage infrastructure state?
Think about where each tool keeps track of the resources it manages.
CloudFormation automatically manages the state of your infrastructure within AWS itself, so you don't have to handle state files. Terraform, however, uses a state file that you must manage, often stored remotely in places like AWS S3 for team collaboration.
Which option correctly identifies the multi-cloud support capabilities of CloudFormation and Terraform?
Consider which tool is designed specifically for AWS and which is more flexible.
CloudFormation is an AWS-specific service designed to manage AWS resources only. Terraform supports many cloud providers, including AWS, Azure, Google Cloud, and others, making it suitable for multi-cloud environments.
When managing sensitive information like passwords or API keys in CloudFormation and Terraform, which practice is most secure and recommended?
Think about how each tool integrates with AWS services for secret management.
CloudFormation integrates well with AWS Secrets Manager and Parameter Store to reference secrets securely without embedding them in templates. Terraform can also integrate with external secret managers or AWS services but requires explicit configuration. Storing secrets in plain text or embedding them directly is insecure.
Which approach best helps detect and manage infrastructure drift when using CloudFormation and Terraform?
Consider built-in features and commands each tool provides to check for changes outside their control.
CloudFormation offers a drift detection feature to identify changes made outside of its management. Terraform uses the plan command to show differences between the current state and desired configuration before applying changes. Manual inspection or deleting resources are not practical or recommended.
Given a CloudFormation template and a Terraform configuration both defining an AWS VPC and an EC2 instance that depends on the VPC, how do these tools handle deployment order?
Think about how each tool understands resource relationships.
Both CloudFormation and Terraform analyze resource references and dependencies to determine the correct order of creation automatically. CloudFormation uses intrinsic functions and references, and Terraform uses resource references in configuration. Explicit DependsOn is only needed in CloudFormation for special cases.