Terraform Flashcards

1
Q

What is IAC and what does it do?

A
  • Infrastructure as Code
  • Mange infrastructure with configuration files rather than using a GUI
  • Declarative rather than procedural
  • Ensures safe, consistent, and repeatable deployments.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Terraform?

A

IAC tool from HshiCorp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages of using Terraform.

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the Terraform key concepts?

A
  • main.tf
  • Plugins / Providers
  • Registry
  • Modules
  • State
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the five steps in the Terraform workflow?

A
  1. Scope: Identify the infrastructure.
  2. Author: Write configuration files.
  3. Initialize: Install required plugins/providers.
  4. Plan: Preview changes.
  5. Apply: Execute and provision resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of a Terraform state file?

A

It tracks the current state of infrastructure and ensures Terraform makes changes only to match the desired state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Match the command to its function:
1. terraform init
2. terraform plan
3. terraform apply
4. terraform destroy

A
  1. Initializes the project.
  2. Previews infrastructure changes.
  3. Provisions resources.
  4. Removes infrastructure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are Terraform providers, and where can you find them?

A

Providers are plugins for interacting with cloud services and platforms. They can be found in the Terraform Registry.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the prerequisites for using Terraform with AWS?

A
  1. Terraform CLI
  2. AWS CLI
  3. AWS credentials (IAM user or role with permissions)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three main blocks in a Terraform configuration?

A
  1. Terraform Block: Specifies settings, including provider versions.
  2. Provider Block: Configures cloud providers (e.g., AWS).
  3. Resource Block: Defines infrastructure components like compute instances.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Terraform enable collaboration?

A

Using remote state backends, teams can securely share state files to avoid race conditions and use tools like GitHub for version control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly