DEV Community

DHANYA RAVI
DHANYA RAVI

Posted on

RUNNING LINUX COMMANDS AND UPLOADING THE OUTPUT TO S3 DIRECTLY THROUGH EC2 INSTANCE

Step 1: Create an ec2 instance

Give a name for the ec2 instance and select amazon machine image
Image description

Create a key value pair and the instance type should be t2.micro
Image description

Once the instance is created wait until the status turns into running state
Image description

Download putty and configure it
Image description

White listing my ip address so that only I can acccess it by editing the inbound rules
Image description

Step 2: Connecting puTTy with the ec2 instance.

Image description

Go to the puTTy gen and select the pem key that was downloaded while creating the key value pair and generate it to get the private key.

In the puTTy configuration go to the SSH category and in that select admin and in that select config and then enter the public IP address and load the private key that was saved and connect.

Image description

Run the linux commands and get the output and save it in a file .

Image description

Step 3: Create roles.

Image description

Go to the create role and in the entity type select AWS service.

Image description

In the use case select ec2 and give the role name and create the role.
Image description

The role is created.
Image description

Step 4: Now go to the ec2 instance type and select the instance and in the actions go to the security option.

Image description

In the security go to the modify iam role option.

Image description

Select the role that we created and then hit update.

Image description

Now the ec2 instance will be connected to the iam role.

Image description

Step 5: Once we enter the command [aws s3 cp filename.txt s3://bucket name/] then the file will be uploaded to the bucket.

Image description

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay