<?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: Pyae Thu Aung</title>
    <description>The latest articles on DEV Community by Pyae Thu Aung (@pyaethuaung).</description>
    <link>https://dev.to/pyaethuaung</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%2F191307%2Ff27278b8-33f8-446d-8b2e-9167e94d1e2e.jpeg</url>
      <title>DEV Community: Pyae Thu Aung</title>
      <link>https://dev.to/pyaethuaung</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pyaethuaung"/>
    <language>en</language>
    <item>
      <title>How to Add Existing Project to AWS CodeCommit</title>
      <dc:creator>Pyae Thu Aung</dc:creator>
      <pubDate>Fri, 06 Sep 2019 14:43:09 +0000</pubDate>
      <link>https://dev.to/pyaethuaung/how-to-add-existing-project-to-aws-codecommit-2071</link>
      <guid>https://dev.to/pyaethuaung/how-to-add-existing-project-to-aws-codecommit-2071</guid>
      <description>&lt;h2&gt;
  
  
  1. Add Required Permission to User
&lt;/h2&gt;

&lt;p&gt;Attach &lt;code&gt;AWSCodeCommitFullAccess&lt;/code&gt; permission to user. If current user has not proper permission to do changes to CodeCommit&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create Repository At CodeCommit
&lt;/h2&gt;

&lt;p&gt;Simply create new repository by clicking &lt;strong&gt;Create repository&lt;/strong&gt;, add repository name and description(optional) and click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Check Existing SSH Key
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal&lt;/li&gt;
&lt;li&gt;Enter following to see is there existing SSH keys:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ls -al ~/.ssh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Check the listing for existing SSH key. By default, public keys are one of the following:

&lt;ul&gt;
&lt;li&gt;id_dsa.pub&lt;/li&gt;
&lt;li&gt;id_ecdsa.pub&lt;/li&gt;
&lt;li&gt;id_ed25519.pub&lt;/li&gt;
&lt;li&gt;id_rsa.pub&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  4. Generate New SSH Key
&lt;/h2&gt;

&lt;p&gt;Create new SSH key if there is not existing key:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal&lt;/li&gt;
&lt;li&gt;Enter following to generate SSH key:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I prefer to set SSH key location to save as default and passphrase is optional as you can set additional security layer.&lt;br&gt;
   You can find newly generated SSH private and public keys under ~/.ssh folder.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Add SSH Public Key to AWS IAM User
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Copy SSH Public Key to Clipboard:
Let's say &lt;strong&gt;id_rsa.pub&lt;/strong&gt; public SSH key is already existing. Copy 
this to clipboard by following terminal command:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   pbcopy &amp;lt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Upload SSH Public Key to IAM User
Add copied public SSH key to &lt;strong&gt;SSH keys for AWS CodeCommit&lt;/strong&gt; under &lt;strong&gt;Security credential&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Copy SSH Key ID of added SSH key
This SSH Key ID will be added to &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  6. Add/Edit SSH Config file
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;config&lt;/code&gt; file under &lt;code&gt;~/.ssh&lt;/code&gt; if it's not created yet and add following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host git-codecommit.*.amazonaws.com
  User APKA5R243QHS7VQYN7O2
  IdentityFile ~/.ssh/codecommit_rsa
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Init Existing Project as Git
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal&lt;/li&gt;
&lt;li&gt;Initialize existing project directory as a git repository, add files in the directory and commit:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git init
   git add .
   git commit -m "First commit"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add remote repository URL and push:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git remote add origin &amp;lt;remote_repository_url&amp;gt;
   git push -u origin master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check created CodeCommit repository and existing local project files should be found.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>codecommit</category>
      <category>git</category>
    </item>
  </channel>
</rss>
