DevOps Classroom Series – 16/Dec/2021

Activity: From Terraform Create an S3 bucket in AWS Cloud (Contd)

  • Create a new folder and create an empty file main.tf in it.
  • Open this folder with vscode
  • Install Terraform Extension from Hashicorp Preview Preview
  • Create the basic provider skeleton syntax Preview
  • Install AWS CLI
    • Windows => choco install awscli
    • Mac => brew install awscli
  • Create an IAM authentication as mentioned Refer Here
  • Now execute aws configure and enter the secret access key id and access key, region (us-west-2) and output format => json
  • So after configuring credentials. Execute terraform init to download the providers configured Preview
  • Now we need to configure the resource s3_bucket Refer Here
  • Now fill the required arguments Refer Here
  • Now lets check for the validity of the configuration which we have written Preview
  • Now try creating the resources by executing terraform apply Preview Preview
  • Now check for the resources created or not Preview
  • Once the infra is created, lets execute terraform apply again Preview
  • Terraform is idempotent i.e. when you run terraform multiple times to create the infrastructure it will lead to the same result i.e. your desired state
  • Now lets change the acl to public-read & apply Preview Preview Preview
  • Now lets try to delete the infrastructure which we have created Preview Preview Preview
  • Refer Here for the changes done in the main.tf file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube