Securely deploy your infrastructure on AWS using the Gitlabs pipeline

Surajtikoo
Towards AWS
Published in
3 min readNov 22, 2023

--

In our fast-paced world, automation is key to simplifying tasks and boosting efficiency. With just a click, we can automate various processes, reducing manual work. One common example is connecting to AWS using GitLab in Continuous Integration/Continuous Deployment (CI/CD) pipelines.

To make this connection seamless, we normally create an “IAM” user with the necessary permissions. By integrating GitLab with AWS IAM, we automate the authorisation process. This means developers don’t have to worry about manual setups, allowing them to focus on writing code and improving applications. Automation in CI/CD pipelines not only saves time but also ensures a smooth workflow, making software development faster and more efficient.

Below reference digram shows the typical way to connect to the AWS account.

In the above architecture diagram, an IAM user (GitLab user) with administrative privileges is depicted, allowing for various AWS operations. This setup is replicated across other accounts as well. However, this approach comes with a significant risk, if our access keys are compromised, there’s a high chance of our AWS account being compromised too.

To address this challenge, some organizations resort to storing secrets like access keys and secret IDs in…

--

--

Technology Enthusiast |AWS Community Member | Datadog Ambassador |DevOps Consultant | AWS DevOps Professional Certified | Terraform Certified