Step 1: Launch a EC2 instance in your console.
Step 2: Give a instance name to your instance.
Step 3: Select t2.micro instance type.
Step 4: Create a new key pair for your instance.
Click Launch instance.
Step 4: After creating your instance click your instance and go to the security and change your inbound rules for your instance.
Change the custom ip to my ip address.
And click save rules.
Step 5: Go to the putty app, if you are not downloaded then download it.
If your key pair is .ppm file then change it to private key with the help of puttygen.
After converting it go to the putty and enter the host ip address. And then go to the "SSH" which is in the category then click "Auth" in that click "Credentials". In that enter your private key file for authentication. And then click open.
Step 6: Your Terminal gets opened in that just create a file and add some contents in it.
Command to create a file
cat < "file_name.txt"
To view the content in the file
cat "file_name.txt"
Step 7: Go to the AWS console and then go to the IAM->Roles. Create a role with "S3fullAccess" policy.
Step 8: Go to EC2 instance and click actions and then click security and go the modify IAM role and change the IAM role.
Step 7: Go to the terminal, we need to put the created file in the AWS S3 so enter the command
aws s3 cp "file_name.txt s3://"bucket_name"
If there is no bucket in the S3 then create it by using the command.
aws s3 mb s3://"bucket_name"
After creating it upload the created file in the bucket by using the command.
aws s3 cp "file_name.txt s3://"bucket_name"
After uploading the files go check your AWS console to verify it.
Completing every steps delete or terminate everything that you have created(EC2, S3, IAM).
Top comments (0)