Terraform Flashcards
What is IAC and what does it do?
- Infrastructure as Code
- Mange infrastructure with configuration files rather than using a GUI
- Declarative rather than procedural
- Ensures safe, consistent, and repeatable deployments.
What is Terraform?
IAC tool from HshiCorp
What are the advantages of using Terraform.
- Manage infrastructure on multiple cloud platforms -cloud agnostic
- Write code more quickly with human readable format (HCL)
- Terraform STATE allows you to track changes in your infrastructure
- Commit and share infrastructure configuration and changes using version control.
What are the Terraform key concepts?
- main.tf
- Plugins / Providers
- Registry
- Modules
- State
What are the five steps in the Terraform workflow?
- Scope: Identify the infrastructure.
- Author: Write configuration files.
- Initialize: Install required plugins/providers.
- Plan: Preview changes.
- Apply: Execute and provision resources.
What is the purpose of a Terraform state file?
It tracks the current state of infrastructure and ensures Terraform makes changes only to match the desired state.
Match the command to its function:
1. terraform init
2. terraform plan
3. terraform apply
4. terraform destroy
- Initializes the project.
- Previews infrastructure changes.
- Provisions resources.
- Removes infrastructure.
What are Terraform providers, and where can you find them?
Providers are plugins for interacting with cloud services and platforms. They can be found in the Terraform Registry.
What are the prerequisites for using Terraform with AWS?
- Terraform CLI
- AWS CLI
- AWS credentials (IAM user or role with permissions)
What are the three main blocks in a Terraform configuration?
- Terraform Block: Specifies settings, including provider versions.
- Provider Block: Configures cloud providers (e.g., AWS).
- Resource Block: Defines infrastructure components like compute instances.
How does Terraform enable collaboration?
Using remote state backends, teams can securely share state files to avoid race conditions and use tools like GitHub for version control.