{"id":390,"date":"2025-07-03T08:09:18","date_gmt":"2025-07-03T08:09:18","guid":{"rendered":"https:\/\/www.sudeepa.com\/?p=390"},"modified":"2025-07-04T04:56:52","modified_gmt":"2025-07-04T04:56:52","slug":"configuring-gitlab-ci-cd-for-aws-deployment-using-ssh-keys","status":"publish","type":"post","link":"https:\/\/sudeepa.com\/?p=390","title":{"rendered":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys"},"content":{"rendered":"\n<p style=\"font-size:20px\">Setting Up Secure SSH Connections Between GitLab and AWS<\/p>\n\n\n\n<p>Here&#8217;s a step-by-step guide to configure GitLab CI\/CD pipelines for deploying to AWS EC2 instances using SSH key authentication:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Key Preparation<\/strong><\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Convert PPK to PEM<\/strong> (using PuttyGen):\n<ul class=\"wp-block-list\">\n<li>Open your existing PPK private key in PuttyGen<\/li>\n\n\n\n<li>Navigate to Conversions \u2192 Export OpenSSH key<\/li>\n\n\n\n<li>Save as a PEM file (e.g., <code>my-key.pem<\/code>)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Add the PEM file content to GitLab:\n<ul class=\"wp-block-list\">\n<li>Go to your project \u2192 Settings \u2192 CI\/CD \u2192 Variables<\/li>\n\n\n\n<li>Add a new variable:\n<ul class=\"wp-block-list\">\n<li>Key: <code>SSH_PRIVATE_KEY<\/code><\/li>\n\n\n\n<li>Value: Content of your PEM file<\/li>\n\n\n\n<li>Check &#8220;Mask variable&#8221; and &#8220;Protect variable&#8221; options<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Generate public key from pem file and append that to AWS user .ssh\/authorized_keys\n<ul class=\"wp-block-list\">\n<li>Run the following command in your terminal (Linux\/macOS\/WSL)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-keygen -y -f \/path\/to\/your-key.pem > \/path\/to\/your-key.pub<\/pre>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting Up Secure SSH Connections Between GitLab and AWS Here&#8217;s a step-by-step guide to configure GitLab CI\/CD pipelines for deploying to AWS EC2 instances using SSH key authentication: 1. Key Preparation ssh-keygen -y -f \/path\/to\/your-key.pem > \/path\/to\/your-key.pub<\/p>\n","protected":false},"author":1,"featured_media":336,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sudeepa.com\/?p=390\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog\" \/>\n<meta property=\"og:description\" content=\"Setting Up Secure SSH Connections Between GitLab and AWS Here&#8217;s a step-by-step guide to configure GitLab CI\/CD pipelines for deploying to AWS EC2 instances using SSH key authentication: 1. Key Preparation ssh-keygen -y -f \/path\/to\/your-key.pem &gt; \/path\/to\/your-key.pub\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sudeepa.com\/?p=390\" \/>\n<meta property=\"og:site_name\" content=\"K8S &amp; Open Code | Tech Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-03T08:09:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-04T04:56:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/Untitled-11.png\" \/>\n\t<meta property=\"og:image:width\" content=\"944\" \/>\n\t<meta property=\"og:image:height\" content=\"514\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sudeepa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sudeepa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/sudeepa.com\/?p=390#article\",\"isPartOf\":{\"@id\":\"https:\/\/sudeepa.com\/?p=390\"},\"author\":{\"name\":\"sudeepa\",\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190\"},\"headline\":\"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys\",\"datePublished\":\"2025-07-03T08:09:18+00:00\",\"dateModified\":\"2025-07-04T04:56:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/sudeepa.com\/?p=390\"},\"wordCount\":127,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190\"},\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/sudeepa.com\/?p=390#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sudeepa.com\/?p=390\",\"url\":\"https:\/\/sudeepa.com\/?p=390\",\"name\":\"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog\",\"isPartOf\":{\"@id\":\"https:\/\/sudeepa.com\/#website\"},\"datePublished\":\"2025-07-03T08:09:18+00:00\",\"dateModified\":\"2025-07-04T04:56:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/sudeepa.com\/?p=390#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sudeepa.com\/?p=390\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sudeepa.com\/?p=390#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sudeepa.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sudeepa.com\/#website\",\"url\":\"https:\/\/sudeepa.com\/\",\"name\":\"K8S &amp; Open Code | Tech Blog\",\"description\":\"Devop with python, php, Perl and K8s for Modern Linux Sys Admins\",\"publisher\":{\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sudeepa.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190\",\"name\":\"sudeepa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/cropped-ChatGPT-Image-Jun-14-2025-05_10_11-PM.png\",\"contentUrl\":\"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/cropped-ChatGPT-Image-Jun-14-2025-05_10_11-PM.png\",\"width\":1534,\"height\":683,\"caption\":\"sudeepa\"},\"logo\":{\"@id\":\"https:\/\/sudeepa.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.sudeepa.com\"],\"url\":\"https:\/\/sudeepa.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sudeepa.com\/?p=390","og_locale":"en_US","og_type":"article","og_title":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog","og_description":"Setting Up Secure SSH Connections Between GitLab and AWS Here&#8217;s a step-by-step guide to configure GitLab CI\/CD pipelines for deploying to AWS EC2 instances using SSH key authentication: 1. Key Preparation ssh-keygen -y -f \/path\/to\/your-key.pem > \/path\/to\/your-key.pub","og_url":"https:\/\/sudeepa.com\/?p=390","og_site_name":"K8S &amp; Open Code | Tech Blog","article_published_time":"2025-07-03T08:09:18+00:00","article_modified_time":"2025-07-04T04:56:52+00:00","og_image":[{"width":944,"height":514,"url":"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/Untitled-11.png","type":"image\/png"}],"author":"sudeepa","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sudeepa","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sudeepa.com\/?p=390#article","isPartOf":{"@id":"https:\/\/sudeepa.com\/?p=390"},"author":{"name":"sudeepa","@id":"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190"},"headline":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys","datePublished":"2025-07-03T08:09:18+00:00","dateModified":"2025-07-04T04:56:52+00:00","mainEntityOfPage":{"@id":"https:\/\/sudeepa.com\/?p=390"},"wordCount":127,"commentCount":0,"publisher":{"@id":"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190"},"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sudeepa.com\/?p=390#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sudeepa.com\/?p=390","url":"https:\/\/sudeepa.com\/?p=390","name":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys - K8S &amp; Open Code | Tech Blog","isPartOf":{"@id":"https:\/\/sudeepa.com\/#website"},"datePublished":"2025-07-03T08:09:18+00:00","dateModified":"2025-07-04T04:56:52+00:00","breadcrumb":{"@id":"https:\/\/sudeepa.com\/?p=390#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sudeepa.com\/?p=390"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sudeepa.com\/?p=390#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sudeepa.com\/"},{"@type":"ListItem","position":2,"name":"Configuring GitLab CI\/CD for AWS Deployment Using SSH Keys"}]},{"@type":"WebSite","@id":"https:\/\/sudeepa.com\/#website","url":"https:\/\/sudeepa.com\/","name":"K8S &amp; Open Code | Tech Blog","description":"Devop with python, php, Perl and K8s for Modern Linux Sys Admins","publisher":{"@id":"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sudeepa.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/sudeepa.com\/#\/schema\/person\/2549870514be49a6d137338460c4e190","name":"sudeepa","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sudeepa.com\/#\/schema\/person\/image\/","url":"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/cropped-ChatGPT-Image-Jun-14-2025-05_10_11-PM.png","contentUrl":"https:\/\/sudeepa.com\/wp-content\/uploads\/2025\/06\/cropped-ChatGPT-Image-Jun-14-2025-05_10_11-PM.png","width":1534,"height":683,"caption":"sudeepa"},"logo":{"@id":"https:\/\/sudeepa.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.sudeepa.com"],"url":"https:\/\/sudeepa.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sudeepa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=390"}],"version-history":[{"count":1,"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions\/391"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sudeepa.com\/index.php?rest_route=\/wp\/v2\/media\/336"}],"wp:attachment":[{"href":"https:\/\/sudeepa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sudeepa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sudeepa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}