Terraform

Write a configuration of a Terraform provider (any type you would like)

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

AWS is one of the most popular providers in Terraform. Here is an example of how to configure it to use one specific region and specifying a specific version of the provider

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

# Configure the AWS Provider
provider "aws" {
  region = "us-west-2"
}