Introduction
The first resource I create and provision using terraform is the AWS S3 bucket. By writing terraform configuration files ( .tf files ) to initialise providers and use terraform commands to interact with AWS APIs and provision resources.
AWS CLI for credentials setup before creating any resource in AWS using aws configure .
The below image shows the procedure of provisioning a simple S3 Bucket.
Terraform Configuration
The set up for this resource involves only two block: the provider configuration block and the S3 bucket resource block
The Provider Block
Since we are using the AWS provider we setup by specifying the region in which the resource will be created
provider "aws" { region = "us-east-1" }
Enter fullscreen mode
Exit fullscreen mode
S3 Bucket Resource Block
resource "aws_s3_bucket" "demo_bucket" { bucket = "devbrio53-store"
tags = { Name = "My bucket" Environment = "Dev" } }
Enter fullscreen mode
Exit fullscreen mode
The Terraform resource block starts with the keyword…