DEV Community

Naveen Kumar
Naveen Kumar

Posted on

Uploading objects into bucket using EC2 (putty) + IAM + S3

  1. Launch an EC2 instance
    Image description
    Image description
    Image description

  2. Download and Install PuTTY
    Image description

  3. White wash your IP address

  4. Edit the inbound rules

    • set the protocol type to SSH
    • Source to My IP Image description
  5. Open PuTTY configuration

    • Copy and paste the public IPv4 address
    • Category: Connection -> SSH -> Auth -> Credentials
    • Enter the Private key file (ppk)
    • Click 'Open' to open Command Line Interface
  6. Run the Linux commands in the CLI

    • echo "sample message" > sample.txt
    • cat sample.txt
    • touch sample.txt
    • aws
  7. create IAM role
    Image description
    Image description
    Image description
    Image description

  8. Modify the IAM role for the instance

    • connect -> security -> modify IAM role
    • select the IAM role
    • update IAM role Image description Image description Image description
  9. Run the following commands in the CLI upload objects into the S3 bucket

    • aws s3 ls
    • aws s3 cp example.txt s3://your-bucket-name/
  10. The objects are uploaded into the S3 bucket using CLI
    Image description

  11. Terminate the Instance

Top comments (0)