Configuring the AWS Provider

Terraform can work against all sorts of "providers", such as AWS, DO, CloudFlare, Azure, Google Cloud, and more.

We'll be concentrating on AWS.

Providers are downloaded from the Terraform Registry. Custom ones can be used, but we'll concentrate on the first-party ones (AWS in particular).

We need to configure our AWS CLI. We'll use profile cloudcasts to make sure we're using the correct account in our case.

Once we get a new GitHub repository setup with Terraform, we can add files to it!

We create a cloudcasts.tf file and start to configure it for use with AWS.

File cloudcasts.tf:

1# File cloudcasts.tf
2terraform {
3 required_providers {
4 aws = {
5 source = "hashicorp/aws"
6 version = "~> 3.0"
7 }
8 }
9}
10 
11provider "aws" {
12 profile = "cloudcasts"
13 region = "us-east-2"
14}

Initialize this Terraform setup:

1terraform init

Don't miss out

Sign up to learn when new content is released! Courses are in production now.