Flashcards
(26 cards)
What is Infrastructure as Code (IaC)?
IaC is the practice of provisioning and managing infrastructure (servers, networks, etc.) using machine-readable configuration files rather than manual processes.
Why is manual configuration problematic?
Manual configuration is error-prone, difficult to keep consistent across environments, and hard to track or transfer knowledge among team members.
What are the main benefits of IaC?
- Consistency and repeatability of environments
- Faster provisioning and updates
- Version control of configurations
- Easier collaboration among team members
What does it mean that IaC is “a blueprint of your infrastructure”?
It means your entire infrastructure configuration is captured in code, acting as a single source of truth for how servers, networks, and other resources are set up.
What is idempotency in IaC?
Idempotency means applying the same configuration multiple times will produce the same result, ensuring consistent infrastructure states.
What is “desired state” in IaC?
“Desired state” refers to the target configuration that you define in code; IaC tools ensure your infrastructure matches this state.
terraform apply
Builds or changes infrastructure according to the configuration.
terraform console
Opens an interactive console for experimenting with Terraform expressions and interpolations.
terraform destroy
Destroys all infrastructure managed by the Terraform configuration.
terraform env
(Note: This command has been replaced by terraform workspace in newer versions)
Manages environments (workspaces) in older Terraform versions.
terraform fmt
Rewrites configuration files to a canonical format and style.
terraform get
Downloads and installs modules required by the configuration.
terraform graph
Generates a visual dependency graph of Terraform resources.
terraform import
Imports existing infrastructure into Terraform’s state.
terraform init
Initializes a Terraform working directory (downloads providers, sets up backend, etc.).
terraform output
Reads and displays output values from the Terraform state file.
terraform plan
Generates and shows an execution plan, detailing the actions Terraform will take.
terraform providers
Lists all the providers used in the configuration, often in a tree format.
terraform push
(Note: This is an older feature related to HashiCorp Atlas and is no longer actively used)
Uploads the Terraform module to Atlas for remote execution.
terraform refresh
Updates the local state file to reflect the real-world infrastructure.
terraform show
Displays detailed information about the current state or a plan file.
terraform taint
Manually marks a resource for recreation during the next apply.
terraform untaint
Removes the “tainted” mark from a resource, preventing its recreation.
terraform validate
Validates the configuration files for syntax errors or inconsistencies.