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
  • Create the basic provider skeleton syntax
  • 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
  • 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
  • Now try creating the resources by executing terraform apply
  • Now check for the resources created or not
  • Once the infra is created, lets execute terraform apply again
  • 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
  • Now lets try to delete the infrastructure which we have created
  • Refer Here for the changes done in the main.tf file.

Leave a ReplyCancel reply

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

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Exit mobile version
%%footer%%