<?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: Kenechukwu Okeke</title>
    <description>The latest articles on DEV Community by Kenechukwu Okeke (@kenechukwu_okeke_cf4ed456).</description>
    <link>https://dev.to/kenechukwu_okeke_cf4ed456</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%2F2930914%2Fc872c9f4-c7ad-4e94-96fb-88f6fbb9be20.png</url>
      <title>DEV Community: Kenechukwu Okeke</title>
      <link>https://dev.to/kenechukwu_okeke_cf4ed456</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kenechukwu_okeke_cf4ed456"/>
    <language>en</language>
    <item>
      <title>Phase 3: Securing Packages with AWS CodeArtifact</title>
      <dc:creator>Kenechukwu Okeke</dc:creator>
      <pubDate>Thu, 13 Mar 2025 19:04:56 +0000</pubDate>
      <link>https://dev.to/kenechukwu_okeke_cf4ed456/phase-3-securing-packages-with-aws-codeartifact-4ddb</link>
      <guid>https://dev.to/kenechukwu_okeke_cf4ed456/phase-3-securing-packages-with-aws-codeartifact-4ddb</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Phase 3 of the Seven Days DevOps Challenge, I'm taking my cloud infrastructure to the next level by implementing AWS CodeArtifact. After setting up an EC2 instance in Phase 1 and integrating with GitHub in Phase 2, this phase focuses on package management - a component of modern software development pipelines.&lt;br&gt;
CodeArtifact provides a secure, scalable artifact repository that integrates seamlessly with common build tools and package managers like Maven. This allowed me to store, publish, and share software packages securely.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Key Learnings&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Through this phase, I gained valuable knowledge on:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Package Management in AWS&lt;/strong&gt;&lt;br&gt;
I learned how to create and configure a secure repository for storing Java packages.&lt;br&gt;
&lt;strong&gt;Repository Domains&lt;/strong&gt;&lt;br&gt;
I understood how CodeArtifact organizes repositories within domains for better governance.&lt;br&gt;
&lt;strong&gt;Upstream Repositories&lt;/strong&gt;&lt;br&gt;
I configured connections to public repositories like Maven Central to automatically pull and cache dependencies.&lt;br&gt;
&lt;strong&gt;Access Control for Packages&lt;/strong&gt;&lt;br&gt;
I implemented proper IAM policies to secure access to package repositories.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Key Tools and Concepts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For this phase, I used the following tools and services:&lt;br&gt;
&lt;strong&gt;AWS CodeArtifact&lt;/strong&gt;&lt;br&gt;
A fully managed artifact repository service that makes it easy to securely store and share software packages.&lt;br&gt;
&lt;strong&gt;Maven&lt;/strong&gt;&lt;br&gt;
A build automation tool used primarily for Java projects to manage dependencies.&lt;br&gt;
&lt;strong&gt;AWS IAM&lt;/strong&gt;&lt;br&gt;
Identity and Access Management that provides fine-grained access control to AWS services.&lt;br&gt;
&lt;strong&gt;Upstream repository&lt;/strong&gt;&lt;br&gt;
A backup source where your repository looks for packages if they are not already stored locally.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: CodeArtifact repository&lt;/strong&gt;&lt;br&gt;
The first step was to create a new CodeArtifact repository in the AWS Management Console. I navigated to the CodeArtifact service and set up a repository named "nextwork-devops-day3-kene." I added a description to specify that this repository would store packages related to a Java web application used in NextWork’s CI/CD pipeline series. To ensure dependency management, I selected Maven Central Store as an upstream repository, which allows automatic pulling of public dependencies when needed. To organize my repositories, I created a domain. I named it "nextwork" to match my organization’s naming convention.&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%2Ftgev65ntghp7hlsnsofa.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%2Ftgev65ntghp7hlsnsofa.png" alt="Image description" width="800" height="360"&gt;&lt;/a&gt;&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%2Fhz08mvxtx8mctq8v0j34.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%2Fhz08mvxtx8mctq8v0j34.png" alt="Image description" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Reviewing the Package Flow&lt;/strong&gt;&lt;br&gt;
After setting up the domain and repository, I reviewed the package flow diagram provided by AWS. This helped me understand how packages would be managed within the system:External packages from public:maven-central flow into maven-central-store. My repository retrieves packages from maven-central-store. This ensures that packages are cached and verified before being used in my application. &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%2F5rkd6ha1fxhn56ddqdxp.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%2F5rkd6ha1fxhn56ddqdxp.png" alt="Image description" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Connecting to the Repository&lt;/strong&gt;&lt;br&gt;
Once the domain and repository were set up, I needed to connect my local or cloud environment to CodeArtifact. I clicked on "View connection instructions" in the AWS console to get the setup details. The instructions provided steps to configure my package manager and authentication method.&lt;br&gt;
To authenticate and interact with the repository, I had to generate a CodeArtifact authorization token. The AWS console provided a command for exporting the token using the AWS CLI. However, I needed to ensure my AWS credentials were correctly configured on my system before running the command.&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%2Feqzycmk9y3bfs86c5htl.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%2Feqzycmk9y3bfs86c5htl.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;br&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%2Fjhkcdqlvrs04d60fykge.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%2Fjhkcdqlvrs04d60fykge.png" alt="Image description" width="800" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Connecting to the EC2 Instance&lt;/strong&gt; &lt;br&gt;
To connect the ec2 instance I ran the following code on it in order to export the codeArtifact authorization token for authorization:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain nextwork --domain-owner 039612887229 --region eu-west-1 --query authorizationToken --output text`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code ran in an error because the ec2 instance didn't have the permission to interact with the Code Artifact.&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%2Fpcdy6yzxnzpau3tktxcq.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%2Fpcdy6yzxnzpau3tktxcq.png" alt="Image description" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To solve this issue, I created an IAM role and policy for this purpose. &lt;br&gt;
This role allowed my EC2 instance to authenticate with CodeArtifact securely.&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%2Fjxdghl8k40h5pi21xesj.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%2Fjxdghl8k40h5pi21xesj.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;br&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%2Fu2qik99ru5s5dq1zroc4.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%2Fu2qik99ru5s5dq1zroc4.png" alt="Image description" width="800" height="334"&gt;&lt;/a&gt;&lt;br&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%2Foe4qgk5ug6jqobgpe40q.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%2Foe4qgk5ug6jqobgpe40q.png" alt="Image description" width="800" height="354"&gt;&lt;/a&gt;&lt;br&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%2Fc1msix8mzjx8qq3ku5c2.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%2Fc1msix8mzjx8qq3ku5c2.png" alt="Image description" width="800" height="356"&gt;&lt;/a&gt;&lt;br&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%2Fthsdgxno5dxdvwhj90p3.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%2Fthsdgxno5dxdvwhj90p3.png" alt="Image description" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Creating of the Settings.xml&lt;/strong&gt;&lt;br&gt;
To store the credentials securely in Maven, I created a settings.xml file. This file included the repository credentials, referencing the AWS authorization token dynamically&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%2Fmutegmp9cd2kchcbrstg.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%2Fmutegmp9cd2kchcbrstg.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Compiling the Project with Maven&lt;/strong&gt;&lt;br&gt;
With authentication configured, I proceeded to compile my Java web application using Maven&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn compile --settings settings.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This process successfully pulled dependencies from the CodeArtifact repository&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%2Fmjhk6ilb1gtwazejm019.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%2Fmjhk6ilb1gtwazejm019.png" alt="Image description" width="800" height="246"&gt;&lt;/a&gt;&lt;br&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%2F5s45j46sfo1tmdxbpnm0.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%2F5s45j46sfo1tmdxbpnm0.png" alt="Image description" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Phase 3 of the Seven Days DevOps Challenge demonstrates how to use AWS CodeArtifact to secure and manage dependencies for a web application.This phase builds on the previous work of setting up an EC2 instance and implementing version control with GitHub, adding component to the DevOps pipeline.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>java</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Phase 2: Connecting a GitHub Repo with AWS</title>
      <dc:creator>Kenechukwu Okeke</dc:creator>
      <pubDate>Wed, 12 Mar 2025 18:47:00 +0000</pubDate>
      <link>https://dev.to/kenechukwu_okeke_cf4ed456/phase-2-connecting-a-github-repo-with-aws-468n</link>
      <guid>https://dev.to/kenechukwu_okeke_cf4ed456/phase-2-connecting-a-github-repo-with-aws-468n</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Phase 1 of the Seven Days DevOps Challenge, I set up an EC2 instance on AWS and configured a remote SSH connection using VS Code. Now, in Phase 2, I'll be integrating GitHub with the AWS environment to implement version control for the cloud-based web application.&lt;/p&gt;

&lt;p&gt;This phase is important for DevOps workflows because it enables automatic code updates on AWS whenever changes are pushed to GitHub. Whether you deploy manually using git pull or automate with AWS CodeDeploy, this setup enhances efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key Learnings&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Through this phase, I gained valuable knowledge on the following&lt;br&gt;
&lt;strong&gt;GitHub Authentication Methods&lt;/strong&gt; &lt;br&gt;
I understood the secure alternatives to password authentication and how to implement them.&lt;br&gt;
&lt;strong&gt;Git Workflow Management&lt;/strong&gt; &lt;br&gt;
I learnt how to handle common scenarios like merging changes, resolving conflicts, and synchronizing local and remote repositories.&lt;br&gt;
&lt;strong&gt;Credential Management&lt;/strong&gt; &lt;br&gt;
I properly secured and configured Git credentials for ongoing use.&lt;br&gt;
&lt;strong&gt;AWS and GitHub Integration&lt;/strong&gt;&lt;br&gt;
I established a connection between cloud resources and version control systems, which is fundamental for DevOps practices.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Key Tools and Concepts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For this phase, I used the following tools and services:&lt;br&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;&lt;br&gt;
A platform where developers store and manage their code. It helps track changes and collaborate with others.&lt;br&gt;
&lt;strong&gt;Git&lt;/strong&gt;&lt;br&gt;
A tool that records changes in code, allowing developers to revert, update, and share their work easily.&lt;br&gt;
&lt;strong&gt;Personal Access Token (PAT)&lt;/strong&gt;&lt;br&gt;
A secure key used instead of a password to connect GitHub with Git on the command line.&lt;br&gt;
&lt;strong&gt;Git Commands&lt;/strong&gt;&lt;br&gt;
Basic commands I used to manage code changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git init – Starts a new Git repository.&lt;/li&gt;
&lt;li&gt;git add – Prepares files for a commit.&lt;/li&gt;
&lt;li&gt;git commit – Saves the changes with a message.&lt;/li&gt;
&lt;li&gt;git push – Sends the changes to GitHub.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Creating a GitHub Repository&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; To start integrating my web application with GitHub, I first by signed into  my GitHub account and created a new repository to host the web application code. I named the repository "nextwork-devops-day2-kene" and added this description "This project demonstrates how to set up a web application in the cloud and integrate it with AWS services".&lt;/li&gt;
&lt;/ul&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%2Ft7jznj24l8xatadqis2o.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%2Ft7jznj24l8xatadqis2o.png" alt="Image description" width="776" height="648"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Setting Up GitHub Authentication&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To connect securely from my EC2 instance to GitHub, I needed to set up proper authentication. GitHub no longer supports password authentication for Git operations, so I created a Personal Access Token by navigating to GitHub Settings &amp;gt; Developer settings &amp;gt; Personal access tokens. I created a new personal access token for EC2 instance access then set an expiration period of 7 days (until March 19, 2025)&lt;/li&gt;
&lt;/ul&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%2Fscn5fvyr21t9granp07w.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%2Fscn5fvyr21t9granp07w.png" alt="Image description" width="421" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I selected the necessary scopes for the token:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repo (Full control of private repositories)&lt;/li&gt;
&lt;li&gt;public_repo (Access public repositories)&lt;/li&gt;
&lt;li&gt;repo:status (Access commit status)&lt;/li&gt;
&lt;li&gt;repo_deployment (Access deployment status)&lt;/li&gt;
&lt;li&gt;repo:invite (Access repository invitations)&lt;/li&gt;
&lt;li&gt;security_events (Read and write security events)
&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%2F0ld4pgpxayzyw48sjuod.png" alt="Image description" width="800" height="368"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After generating the token, I copied it immediately because GitHub only displays it once for security reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Installing Git on EC2&lt;/strong&gt;&lt;br&gt;
Before I could connect to GitHub from my EC2 instance, I needed to install Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dnf update -y
sudo dnf install git -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F5499hiqgfhfbdaqbyl6r.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%2F5499hiqgfhfbdaqbyl6r.png" alt="Image description" width="709" height="274"&gt;&lt;/a&gt;&lt;br&gt;
I verified the installation by checking the Git version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Initializing the Local Git Repository&lt;/strong&gt;&lt;br&gt;
Next, I initialized a Git repository in my existing web application directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git responded with a hint that it's using 'master' as the default branch name, while suggesting alternatives like 'main', 'trunk', or 'development' as more commonly used names.&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%2Ftnrqpzvmwknt7glpvz24.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%2Ftnrqpzvmwknt7glpvz24.png" alt="Image description" width="701" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Configuring Git Authentication&lt;/strong&gt;&lt;br&gt;
To push to GitHub, I needed to set up my authentication credentials. When attempting to push using my username and password, I encountered an authentication error because GitHub has deprecated password authentication. To resolve this issue i used my username and Personal Access Token to continue. &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%2F3phrtn400xyqcawhbwr1.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%2F3phrtn400xyqcawhbwr1.png" alt="Image description" width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Resolving Push and Pull Conflicts&lt;/strong&gt;&lt;br&gt;
When trying to push my changes to GitHub, I encountered a rejection because the remote repository contained a file (README.md) that I didn't have locally. To solve this problem i first pulled the repository to my local system before trying to push the changes again&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%2Fn4nf68vk1dps1qu7jcn9.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%2Fn4nf68vk1dps1qu7jcn9.png" alt="Image description" width="800" height="306"&gt;&lt;/a&gt;&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%2Fwt9l44c8fc2z1wa8aoid.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%2Fwt9l44c8fc2z1wa8aoid.png" alt="Image description" width="800" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because I did not want to keep writing my username and Personal Access Token and solved this problem by configuring Git to use my personal access token by storing my credentials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global credential.helper store
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command allowed me to push to the repository without authenticating everytime my token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Final Push and Verification&lt;/strong&gt;&lt;br&gt;
I completed a few more commits and pushes to ensure all my changes were synchronized with GitHub. The web application code, including the index.jsp file, was now properly stored in the GitHub repository and accessible for collaboration. I verified the changes were reflected in GitHub by viewing the repository, which showed my JSP file with the updated content. &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%2F5wkzx7ccwfg74k3j2t0w.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%2F5wkzx7ccwfg74k3j2t0w.png" alt="Image description" width="800" height="323"&gt;&lt;/a&gt;&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%2Fzjtyfjp8ffudhdzpcf1b.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%2Fzjtyfjp8ffudhdzpcf1b.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Challenges and Solutions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;During this phase, I encountered several common Git workflow challenges:&lt;br&gt;
&lt;strong&gt;Authentication Failure&lt;/strong&gt; &lt;br&gt;
GitHub has deprecated password authentication, requiring the use of a personal access token or SSH key. I resolved this by creating a personal access token and configuring Git to store my credentials.&lt;br&gt;
&lt;strong&gt;Divergent Branches&lt;/strong&gt; &lt;br&gt;
When pulling from GitHub after creating files both locally and on GitHub, I faced a divergent branches error. I needed to specify a merge strategy (using git config pull.rebase false) to reconcile these differences.&lt;br&gt;
&lt;strong&gt;Push Rejection&lt;/strong&gt; &lt;br&gt;
My initial push was rejected because the remote repository contained files not present in my local repository. I resolved this by pulling first, then pushing after the merge.&lt;/p&gt;

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

&lt;p&gt;Phase 2 of the Seven Days DevOps Challenge shows how to integrate GitHub with an AWS EC2 instance. This integration ensures that the code is properly tracked, backed up, and can be shared among team members, which is essential for software development workflows.&lt;br&gt;
Stay tuned for Phase 3, where i'll explore storing of dependencies in CodeArtifact 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Set Up a Web App in the Cloud using AWS and VsCode</title>
      <dc:creator>Kenechukwu Okeke</dc:creator>
      <pubDate>Tue, 11 Mar 2025 13:19:16 +0000</pubDate>
      <link>https://dev.to/kenechukwu_okeke_cf4ed456/set-up-a-web-app-in-the-cloud-using-aws-and-vscode-3mfp</link>
      <guid>https://dev.to/kenechukwu_okeke_cf4ed456/set-up-a-web-app-in-the-cloud-using-aws-and-vscode-3mfp</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Deploying a Web Application using AWS can seem overwhelming, but with the right setup, it becomes much easier. This guide walks you through setting up a Web app using AWS services and VsCode, covering everything from prerequisites to common challenges and solutions.&lt;/p&gt;

&lt;p&gt;In this project, I'll be launching an EC2 instance on AWS, setting up a secure remote SSH connection using VsCode, and configuring the necessary development environment. This includes installing Maven and Java, which are essential for building and managing Java-based applications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key concepts I learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating an EC2 instance: Setting up a virtual machine in AWS, choosing an appropriate AMI (Amazon Machine Image), instance type, and configuring security groups.&lt;/li&gt;
&lt;li&gt;Connecting to an EC2 instance via SSH: Using a private key to establish a secure connection between my local machine and the cloud instance.&lt;/li&gt;
&lt;li&gt;Using SSH in VsCode: Configuring VsCode to work with remote SSH connections, allowing direct development on the EC2 instance without needing to switch terminals.&lt;/li&gt;
&lt;li&gt;Installing and Configuring Java &amp;amp; Maven: Setting up the necessary environment for building and running Java-based applications on AWS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key tools and concepts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For this project, I used the following services and tools:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EC2 Instance&lt;/strong&gt;&lt;br&gt;
A virtual computer/Server in the cloud that you can use to run programs, store files, and host websites without needing a physical machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Pair&lt;/strong&gt;&lt;br&gt;
A security system that lets you connect to your EC2 instance safely. It has two parts public Key (to be stored on the cloud computer) and private Key (strictly be saved on your own computer). You use the private key to log in securely instead of using a password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VsCode&lt;/strong&gt;&lt;br&gt;
A code editor that makes it easy to work on your cloud computer remotely. It allows you to edit files and run commands on your EC2 instance without switching to a separate terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSH (Secure Shell)&lt;/strong&gt;&lt;br&gt;
A safe way to connect to your cloud computer over the internet/remotely. It lets you control your EC2 instance, run commands, and transfer files while keeping your connection secure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.pem file&lt;/strong&gt; &lt;br&gt;
This file is a private key file used for secure SSH authentication. It is part of a key pair that AWS provides when you create an EC2 instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Launching an EC2 instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I started this project by launching an EC2 instance because the web app will be entirely created and run on the cloud. I selected Amazon Linux  as my AMI since it’s lightweight, secure, and comes with pre-installed packages that are useful for development. And I chose the t2.micro instance, which is part of the AWS Free Tier, making it cost-effective while providing sufficient resources for this project.&lt;br&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%2Fkzw0qqtefpr7y2mxopng.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%2Fkzw0qqtefpr7y2mxopng.png" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I created a new key pair to securely connect to my instance and downloaded the .pem file, which is required for authentication when using SSH.&lt;br&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%2F66apfzc0o1zsec1p4ue1.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%2F66apfzc0o1zsec1p4ue1.png" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I opened port 22 (SSH) to allow remote access and restricted SSH access to my IP address instead of allowing access from anywhere (0.0.0.0/0), thereby enhancing security. &lt;br&gt;
After verifying the configurations, I launched the instance. Once it was up and running, I noted the public DNS for connecting via SSH.&lt;br&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%2Fmlj0ho7i3m8u97qhm3uo.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%2Fmlj0ho7i3m8u97qhm3uo.png" alt="Image description" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Connecting to the Instance using VsCode&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I used VsCode to connect to my EC2 instance via SSH.&lt;br&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%2F69h7hf0ciddcrze821dh.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%2F69h7hf0ciddcrze821dh.png" alt="Image description" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I opened the terminal and entered into the directory where the .pem file was to change the permissions in order to restrict access to the file (.pem), making it readable only by me. &lt;br&gt;
I used the command below to change the file permissions of the private key (.pem file) to make it more secure.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 400 my-nextwork-keypair.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fq9vusad3tdi6j1blbvsh.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%2Fq9vusad3tdi6j1blbvsh.png" alt="Image description" width="740" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I connected to the instance throught my Vscode terminal and typed yes since the system does not recognize the EC2 instance as a trusted host yet. 
Tying yes allows SSH to save the server's fingerprint in the ~/.ssh/known_hosts file.
&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%2Fzwec7dv1qaq3bx1ejqrk.png" alt="Image description" width="800" height="167"&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%2F7kxjdq278meb1ez61bws.png" alt="Image description" width="800" height="169"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Installion of Maven &amp;amp; Java&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this step i installed Maven and Java. Maven is required in this project because it automates the process of Compiling (a process of converting written code into machine code), Linking (compiling machine code with other dependencies), Packaging (assembling Files) and Testing of software and Java is required in this project because I'll be using Amazon Corretto 8, which is free, reliable, and provided by Amazon.&lt;/li&gt;
&lt;/ul&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%2Fltzv4v5sy3a307fbt3le.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%2Fltzv4v5sy3a307fbt3le.png" alt="Image description" width="800" height="197"&gt;&lt;/a&gt;&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%2Fonbgopuezt73yml1od8n.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%2Fonbgopuezt73yml1od8n.png" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I verified the installion by using &lt;strong&gt;mvn -v&lt;/strong&gt; for mava and &lt;strong&gt;java -version&lt;/strong&gt; for java
&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%2Fjt4kf30y4h2azogazg2c.png" width="800" height="228"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Creating the application&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I generated a Java web app using the command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn archetype:generate 
\ -DgroupId=com.nextwork.app 
\ -DartifactId=nextwork-web-project \ -
DarchetypeArtifactId=maven-archetype-webapp 
\ -DinteractiveMode=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fz4i4tkixlbs44hjc2tag.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%2Fz4i4tkixlbs44hjc2tag.png" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I installed "Remote - SSH", which is a VsCode's extension that allows you to connect to remote machines or servers using the SSH protocol and work on them as if they were local.&lt;br&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%2F830mbyvfzfre4whcvnkx.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%2F830mbyvfzfre4whcvnkx.png" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I set up the configuration details required to establish a remote connection include the Host(matching your EC2 instance's IPv4 DNS), the IdentityFile (pointing to the .pem key location on your local machine), and the User&lt;br&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%2F3xteme50p4zp5k7frs70.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%2F3xteme50p4zp5k7frs70.png" width="800" height="201"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using VsCode's file explorer, I navigated the directory structure and files on my remote EC2 server through the "Remote - SSH" extension. This feature allowed me to view and manage project files just as if they were on my local machine.&lt;br&gt;
To generate the project, I used Maven, a build automation tool that creates a structured template for Java applications. When the project was set up, Maven automatically generated key folders, including:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;src Folder – Contains the application's source code, where all Java classes and logic are written.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;webapp Folder – Holds web-related and configuration files for building and running the web application.&lt;br&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%2Fgq7buyo5axfurvfbl1zm.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%2Fgq7buyo5axfurvfbl1zm.png" width="774" height="615"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Using Remote SSH&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Index.jsp is a Java Server Pages (JSP) file that serves as the default landing page for a web application. It typically contains HTML mixed with Java code to dynamically generate content. I edited the index.js code by updating the HTML code to say my name.&lt;/li&gt;
&lt;/ul&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%2Fc9h3juoxrnncjt1ex96i.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%2Fc9h3juoxrnncjt1ex96i.png" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This project marks Phase 1 of the Seven Days DevOps Challenge by setting up an EC2 instance and connecting via SSH using VsCode is a fundamental step in cloud-based development. By configuring security settings, managing key pairs, and establishing a remote connection, I have successfully laid the groundwork for deploying and managing the application on AWS.&lt;/p&gt;

&lt;p&gt;See you in phase two !!🚀&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
      <category>vscode</category>
      <category>java</category>
    </item>
  </channel>
</rss>
