S3 bucket on AWS using Terraform :
π Hello, and welcome to my DevOps journey! π I am Priyanka Varshney,π οΈ As an aspiring DevOps engineer, I'm all about bridging the gap between development and operations, making software delivery seamless and efficient. π»π§ On this Hashnode blog, I'll be sharing my learnings, experiences and adventures as I dive deep into the world of continuous integration, automation, and cloud technologies. βοΈβοΈ Let's connect, learn, and grow as a vibrant DevOps community. Follow my Hashnode blog, and let's embrace the DevOps adventure together! π€π

In the previous blog we will get to know how to create a resource or file using terraform concept
Now we will make a s3 bucket on AWS using Terraform :
Need to create a EC2 instance and install Terraform by using the previous blog .
Create a file using vim editor
vim s3.tfresource aws_s3_bucket my_bucket { bucket="varpriya/terraform" }Create another terraform file for installing aws terraform provider
vim terraform.tfusing this fileterraform { required_providers { aws = { source = "hashicorp/aws" version = "5.92.0" } } }
Then initialize the terraform using command
terraform initThen need to install AWS CLI to connecting with your account.
To install the AWS CLI, run the following commands.
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/installNote : Need to install the Unzip in order to unzip the file
sudo apt-get install unzipYou need to configure the AWS CLI with your AWS EC2 account
aws configureyou will need access key ID
In order to get the access key ID and secret key ID , we will need to create a user from IAM service in AWS
- Go to the IAM service and click on users from the Dashboard.

Create a user named Terra-admin and give the permission AmazonS3FullAccess by clicking on attach policies directly.

- Click on next and then create user.
Now Terra-admin user is created successfully.

- To obtain the access key, navigate to the user profile, select "Security Credentials," create a security key, and then choose the "Command Line Interface (CLI)" option. After that, confirm your action and proceed by clicking "Next."

5. Now you will get two access key ID

Now you can copy paste the keys in your local machine

You can see the all S3 bucket by using the command
aws s3 lsYou can apply now to create the S3 bucket.

Now you can go to the s3 on amazon , you can see the s3 bucket.

Happy learning :)