Question 1 · Infrastructure as Code (IaC) with Terraform
Your organization needs to deploy identical infrastructure across AWS, Azure, and GCP without rewriting code for each cloud provider. Which Terraform approach best enables this multi-cloud strategy?
- Use provider aliases and variables to abstract cloud-specific differences, allowing the same module to work across multiple cloud providers
- Create separate Terraform configurations for each cloud provider and manually synchronize changes across all three
- Use cloud-specific CLI tools for each provider instead of Terraform to maintain provider-native configurations
- Store infrastructure definitions in JSON format rather than HCL to ensure cloud compatibility
Correct answer: Use provider aliases and variables to abstract cloud-specific differences, allowing the same module to work across multiple cloud providers
Terraform's provider abstraction layer and variable system allow you to write cloud-agnostic modules that can deploy to multiple providers by simply changing variable values or provider configurations. Option B is inefficient and error-prone, while C and D contradict Terraform's core design principles of using HCL and provider plugins.





