GoConqr has a new look! Let us know what you think.

Flashcards

Terraform Revision

William Holtam DevOps Learning Technology Specialist English 40 cards

Cards in this deck (40)

  1. 1What is IaC?You write and execute the code to define, deploy, update, and destroy your infrastructure.
  2. 2What are the benefits of IaC?a. Automation
    We can bring up the servers with one script and scale up and down based no our load with the same script.
    b. Reusability of the code
    We can reuse the same code.
    c. Versioning
    We can check it into version control and we get versioning. Now we can see an incremental history of who changed what, how is our infrastructure actually defined at any given point of time, and we have transparancy of documentation.
    IaC makes changes idempotent, consistent, repeatable, and predictable.
  3. 3How using IaC makes it easy to prvision infrastructure?IaC makes it easy to provision and apply infrastructure configurations, saving time. It standardise workflows across different infrastructure providers (e.g., VMware, AWS, Azure, GCP, etc.) by using a common syntax across all of them.
  4. 4What is ideompodent in terms of IAC?The idempotent characteristic provided by IaC tools ensures that, even if the same code is applied multiple times, the result remains the same.
  5. 5What are Day 0 and Day 1 activities?IaC can be applied throughout the lifecycle, both on the initial build, as well as throughout the life of the infrastructure. Commonly, these are referred to as Day 0 and Day 1 activities.
    "Day 0" code provisions and configures your initial infrastructure.
    "Day 1" refers to OS and application configurations you apply after you've initially built your infrastructure.
  6. 6What are the use cases of Terraform?Heroku App Setup
    Multi-Tier Applications
    Self-Service Clusters
    Software Demos
    Disposable Environments
    Software Defined Networking
    resource Schedulers
    Multi-Cloud Deployment
  7. 7WHat are the advantages of Terraform?Platform Agnostic
    State Management
    Operator Confidence
  8. 8What do you describe all the components or your entire datacenter so that Terraform provision those?Configuration files ends with *.tf
  9. 9How can Terraform build infrastructure so efficiently?Terraform builds a graph of all your resources, and parrallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.
  10. 10What is multi-cloud deployment?Provisioning your infrastructure into multiple could providers to increase fault-tolerance of your applications.
  11. 11How multi-cloud deployment is useful?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.
  12. 12What is cloud-agnostic in terms of provisioning tools?Cloud-agnostic allows a single configuration to be used to manage multiple providers, and even to handle cross-cloud dependencies
  13. 13Is Terraform cloud-agnostic?Yes
  14. 14What is the use of terraform being cloud-agnostic?It simplifies management and orchestration, helping operators build large-scale multi-cloud infrastructures.
  15. 15What is Terraform State?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 /som/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.
  16. 16What is the purpose of the Terraform State?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 tha 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 stoes 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
  17. 17What is the name of the terraform state file?terraform.tfstate
  18. 18How do you install terraform on different OS?//Mac OS
    brew install terraform
    //Windows
    choco install terraform
  19. 19How do you manually install terraform?1. Download zip file
    2. mv ~/Downloads/terraform /usr/local/bin/terraform
  20. 20Where do you put terraform configurations so that you can configure some behaviours of Terraaform itself?The special terraform configuration block type is used to configure some behaviours of Terraform itself, such as requiring a minimum Terraform version to apply your configuration.
    terraform {
    # ...
    }
  21. 21Only constants are allowed inside the terraform block. Is this correct?Yes
  22. 22What are the Providers?A plugin that Terraform uses to translate the API interactions with the service. A provider is responsible for understanding API interactions and exposing resources. Becuse Terraform can interact with any API, you can represent almost any infrastructure type as a resource in Terraform.
  23. 23How do you configure a provider?provider "google" {
    project = "acme-app"
    region = "us-central1"
    }
  24. 24What are the meta-arguments that are defined by Terraform itslef and available for all provider blocks?version: Constraining the allowed provider versions
    alias: Using the same provider with different configurations for different resources
  25. 25What is Provider initialization and why do we need it?Each time a new provider is added to configuration - either explicitly via a provider block or by adding a resource from that provider -- Terraform must initialize the provider before it can be used.
    Initialization downloads and installs the provider's plugin so that it can later be executed.
  26. 26How do you initialize any provider?Terraform init
  27. 27When you run terraform init command, all the providers are installed in the current working directory. Is thistrue?Providers are only installed for the current work-dir; others can have their own installed provider versions.
    Note: cannot automatically download providers that are not distributed by HashiCorp.
  28. 28How do you constrain the provider version?To constain the provider version as suggested, add a required_providers block inside a terraform block:
    terraform {
    required_providers {
    aws = "~> 1.0"
    }
    }
  29. 29How do you upgrade to the latest acceptable version of the provider?terraform init --upgrade
  30. 30How many ways you can configure provider versions?1. With required_providers blocks under terraform block
    2. Provider version constraints can also be specified using a version argument within a provider block.
  31. 31How do you configure Multiple Provider Instances?Alias
  32. 32Why do we need Multiple Provider instances?Some of the example scenarios:
    a. multiple regions for a cloud platform
    b. targeting multiple Docker hosts
    c. multiple Consul hosts, etc.
  33. 33How do we define multiple Provider conffigurations?Include multiple provider blocks with the same provider name, but set the alias meta-argument to an alias name to use for each additional configuration.
  34. 34How do you select alternate providers?By default, resources use a default provider configuration inferred from the first word of the resource type name. For example a resource of type aws_instance uses the default aws provider configuration unless otherwise stated.
    resource "aws_instance" "foo" {
    provider = aws.west
    #...
    }
  35. 35What is the location of hteuser plugins directory?Windows %APPDATA%\terraform.d\plugins
    Other systems ~/.terraform.d/plugins
  36. 36Third-party plugins should be manually installed. Is that true?True
  37. 37The command terraform init cannot install third-party plugins?True
  38. 38What is the CLI configuration File?It configures per-user settings for CLI behaviours, which apply across all Terraform working directories.
    It is named either .terraformrc or terraform.rc
  39. 39Where is the location of the CLI configuration file?Windows terraform.rc in %APPDATA% dir.
    Other systems .terraformrc in the home directory.
    Can be specified using the TF_CLI_CONFIG_FILE environment variable.
  40. 40What is Provider Plugin Cache?

Information

Description
Learning Technology Specialist DevOps Flashcards on Terraform Revision, created by William Holtam on 20/12/2020.
Created by
William Holtam
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?