Understand Terraform’s purpose (vs other IaC) COPY Flashcards

Explain multi-cloud and provider-agnostic benefits Explain the benefits of state

1
Q

What is multi-cloud deployment?

A

Provisoning your infrastrcutire into multiple cloud providers to increase fault-tolerance of your applications.

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

How multi-cloud deployment is useful?

A

By using only a single region or cloud provider, fault tolerance is limited by the availability of that provider.
Having a multi-cloud deployment allows for more graceful recovery of the loss of a region or entire provider.

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

What is cloud-agnostic in terms of provisioning tools?

A

cloud-agnostic and allows a single configuration to be used to manage multiple providers, and to even handle cross-cloud dependencies.

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

Is Terraform cloud-agostic?

A

Yes

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

What is the use of terraform being cloud-agnostic?

A

It simplifies management and orchestration, helping operators build large-scale multi-cloud infrastructures.

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

What is the Terraform State?

A

Every time you run Terraform, it records information about what infrastructure it created in a Terraform state file.
By default, when you run Terraform in the folder /some/folder, Terraform creates the file /some/folder/terraform.tfstate.
This file contains a custom JSON format that records a mapping from the Terraform resources in your configuration files to the representation of those resources in the real world.

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

What is the purpose of the Terraform State?

A

Mapping to the Real World
Terraform requires some sort of database to map Terraform config to the real world because you can’t find the same functionality in every cloud provider. You need to have some kind of mechanism to be cloud-agnostic

Metadata
Terraform must also track metadata such as resource dependencies, pointer to the provider configuration that was most recently used with the resource in situations where multiple aliased providers are present.

Performance
When running a terraform plan, Terraform must know the current state of resources in order to effectively determine the changes that it needs to make to reach your desired configuration.

For larger infrastructures, querying every resource is too slow. Many cloud providers do not provide APIs to query multiple resources at once, and the round trip time for each resource is hundreds of milliseconds. So, Terraform stores a cache of the attribute values for all resources in the state. This is the most optional feature of Terraform state and is done only as a performance improvement.

Syncing
When two people works on the same file and doing some changes to the infrastructure. Its very important for everyone to be working with the same state so that operations will be applied to the same remote objects.

https://www.terraform.io/docs/state/purpose.html

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

What is the name of the terraform state file?

A

terraform.tfstate

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