<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shubham Srivastava</title>
    <description>The latest articles on DEV Community by Shubham Srivastava (@ershubham).</description>
    <link>https://dev.to/ershubham</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1262141%2Fdb280470-32e7-4814-abf1-6e3568cad317.jpeg</url>
      <title>DEV Community: Shubham Srivastava</title>
      <link>https://dev.to/ershubham</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ershubham"/>
    <language>en</language>
    <item>
      <title>File Archiving to AWS S3 using AWS SDK for Java</title>
      <dc:creator>Shubham Srivastava</dc:creator>
      <pubDate>Sat, 04 Apr 2026 11:53:14 +0000</pubDate>
      <link>https://dev.to/ershubham/file-archiving-to-aws-s3-using-aws-sdk-for-java-4o2b</link>
      <guid>https://dev.to/ershubham/file-archiving-to-aws-s3-using-aws-sdk-for-java-4o2b</guid>
      <description>&lt;p&gt;Many servers process and generate large amounts of data daily, resulting in numerous files. Storing these files on the server for extended periods consumes significant server space. To address this, these files can be efficiently archived into S3 buckets.&lt;/p&gt;

&lt;p&gt;The AWS SDK for Java offers user-friendly APIs for various AWS services. By utilizing the AWS SDK, we can develop a Java application capable of interacting with S3 to perform tasks such as listing buckets, uploading and downloading objects, and executing other S3-related operations.&lt;/p&gt;

&lt;p&gt;Let's begin with a straightforward Java project structured as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq15l6irmdmp6tr7bxjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq15l6irmdmp6tr7bxjv.png" alt=" " width="800" height="722"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our project requires only two Maven dependencies to function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvl8rf9az09t2exxivh2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvl8rf9az09t2exxivh2g.png" alt=" " width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will implement two static methods. The first method will construct an S3 client using essential properties such as the S3 endpoint URL, bucket name, access key ID, and secret access key. These properties become available upon S3 bucket creation. The second method will use this S3 client to establish an HTTP connection with S3 and handle the file upload process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcweilfn22cr3por8kojm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcweilfn22cr3por8kojm.png" alt=" " width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, the main method will iterate through files in a specified directory, compiling a list of files with their respective paths. It will then proceed to upload each file to the S3 bucket using the previously defined upload method. After verifying the files are successfully stored in the S3 bucket, all uploaded files will be deleted from the server to free up space.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5a4u790wot9irtam6c9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5a4u790wot9irtam6c9q.png" alt=" " width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By implementing this Java-based solution, organizations can effectively manage server storage by offloading large volumes of data to AWS S3. The AWS SDK for Java simplifies interaction with S3, enabling the creation of robust applications for archiving files. This approach not only frees up valuable local server space but also leverages the scalability and durability of S3, providing a practical and efficient strategy for long-term data management.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>java</category>
      <category>s3</category>
      <category>cloudstorage</category>
    </item>
    <item>
      <title>Simple steps to create AWS EKS Cluster and Nodes</title>
      <dc:creator>Shubham Srivastava</dc:creator>
      <pubDate>Sun, 14 Apr 2024 18:00:57 +0000</pubDate>
      <link>https://dev.to/ershubham/simple-steps-to-create-aws-eks-cluster-and-nodes-3abb</link>
      <guid>https://dev.to/ershubham/simple-steps-to-create-aws-eks-cluster-and-nodes-3abb</guid>
      <description>&lt;h2&gt;
  
  
  Amazon Elastic Kubernetes Service (EKS):
&lt;/h2&gt;

&lt;p&gt;Kubernetes is a set of open source tools that automates deployment , management and scaling of containerized applications. AWS EKS is a wrapper around Kubernetes that provides managed service to maintain Kubernetes control plane. As it is managed by AWS you do not need to install , scale , maintain and operate control plane.&lt;/p&gt;

&lt;p&gt;Since cloudformation templates are the simplest approach to describe and deliver infrastructure declaratively while utilising maintainability and reusability, I have used them to create Clusters and Nodes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;An active AWS account.&lt;/li&gt;
&lt;li&gt;Basic knowledge of AWS services specifically IAM,EKS and CloudFormation.&lt;/li&gt;
&lt;li&gt;AWS CLI and Kubectl installed and configured on local machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1. Create EKS Cluster
&lt;/h3&gt;

&lt;p&gt;Here is the CloudFormation template for EKS cluster creation. This comprises 3 sections Template Version, Parameters and Resources. &lt;/p&gt;

&lt;h4&gt;
  
  
  AWSTemplateFormatVersion:
&lt;/h4&gt;

&lt;p&gt;Version of the CloudFormation template.&lt;/p&gt;

&lt;h4&gt;
  
  
  Parameters:
&lt;/h4&gt;

&lt;p&gt;Required values that we will pass dynamically while creating stack using AWS CLI&lt;/p&gt;

&lt;h4&gt;
  
  
  Resources:
&lt;/h4&gt;

&lt;p&gt;AWS resources required for the EKS cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffop74kfs6mcbckrf35mq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffop74kfs6mcbckrf35mq.png" alt="Image description" width="800" height="1146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save this file as AWS-EKSClusterTemplate.yml in your local machine and replace default values in Parameters sections and run below command that will create CloudFormation Stack and EKS Cluster.&lt;/p&gt;

&lt;p&gt;Please do not forget to replace default values with your AWS services as these values are specific to my AWS account and will give error. You can use default VPC, Subnet and EC2 key pair from your AWS account.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws cloudformation create-stack --stack-name myClusterStack --template-body file://AWS-EKSClusterTemplate.yml --capabilities CAPABILITY_NAMED_IAM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Create EKS Nodes:
&lt;/h3&gt;

&lt;p&gt;Here is the cf template for EKC Nodes creation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm4gm7t6vqsnpbesxdt8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm4gm7t6vqsnpbesxdt8.png" alt="Image description" width="800" height="559"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6paooajylimmlevqiefr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6paooajylimmlevqiefr.png" alt="Image description" width="800" height="790"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save this file as AWS-EKSNodesTemplate.yml in your local machine and replace default values in Parameters section and run below command to create CloudFormation Stack and EKS Nodes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws cloudformation create-stack --stack-name myNodeStack --template-body file://AWS-EKSNodesTemplate.yml --capabilities CAPABILITY_NAMED_IAM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Login to AWS account and check stack status. This process might take sever minutes. Once its complete stack status must show completed as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp90rx2xu62utgqfd9uwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp90rx2xu62utgqfd9uwy.png" alt="Image description" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Use kubectl to check nodes in cluster and deploy first docker image.
&lt;/h3&gt;

&lt;p&gt;Run kubectl get nodes command in your terminal, it will show 1 node in ready state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o2gn1skn1xmva0ftils.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o2gn1skn1xmva0ftils.png" alt="Image description" width="800" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have not configured kubectl to connect to newly created EKS cluster then run below command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws eks update-kubeconfig --name MyWebCluster&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now our environment is ready for deployment. Let's deploy and test nginx webserver using below command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kubectl run nginx --image=nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01cdd2ipsl45tregz14r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01cdd2ipsl45tregz14r.png" alt="Image description" width="800" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the port-forward feature of kubectl simply tunnels the traffic from a specified port at your localhost machine to the specified port on the pod.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F267fs55j5zat38m8c456.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F267fs55j5zat38m8c456.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, pod is running and serving at port 8080. You can test application by visiting (&lt;a href="http://localhost:8080"&gt;http://localhost:8080&lt;/a&gt;) in web browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgthu72rn0lkmn268f4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgthu72rn0lkmn268f4x.png" alt="Image description" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Clean Up
&lt;/h3&gt;

&lt;p&gt;Cleaning up all the resources that were created above is crucial; failing to do so will result in significant expenses.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws cloudformation delete-stack --stack-name myNodeStack&lt;/code&gt;&lt;br&gt;
&lt;code&gt;aws cloudformation delete-stack --stack-name myClusterStack&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;AWS EKS simplifies managing containerized applications by offering a scalable, secure, and Kubernetes-based platform.  If you're looking for agility and a focus on development, EKS lets you offload cluster management to AWS. Consider EKS for your next containerized project!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>cloudformation</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
