The purpose of this tutorial is to guide you through the various steps involved in deploying sonarqube and a java application in an AWS EKS environment using AWS Cloud Development Kit (AWS CDK) for golang. The java application will be stored in AWS CodeCommit and will use CodeBuild integrated with sonarqube (for code analysis) for production release
The AWS CDK lets you build reliable, scalable, cost-effective applications in the cloud with the considerable expressive power of a programming language. A CloudFormation template is generated for each deployment.
Before you get started, you’ll need to have these things:
- AWS account
- SSO Login
- AWS CLI V2
- AWS Cloud Development Kit (AWS CDK) v2
- Go language installed
- Node.jjs installed
- Kubectl installed is a command line tool that you use to communicate with the Kubernetes API server.
- A Git Client
- AWS git-remote-codecommit Git extension. This will be used to authenticate requests to the repo
- eksctl installed
When setting up a new AWS environment for our project, one of the first things you'll need to do is create a VPC. When setting up the VPC, it is essential to configure security groups to control inbound and outbound traffic to and from the VPC. Security groups act as virtual firewalls, allowing only authorized traffic to pass through. The ports to be authorized (defined in the Security Groups) for input/output are : 9000 (sonarqube default port)
The config_crd.json
Contains the parameters to be initialized to AWS Profil
config_crd.json :
Region: Deployment region
Account: AWS account number
SSOProfile: AWS SSO Profile using
Index: Number to generate a name for the VPC, EKS Cluster,AWS Secret, Stacks .... : <NAME+INDEX>
AWSsecret: AWS Secret name for sonarqube
❗️ You must initialize these variables with your informations.
If you already have VPC to create you can skip this step.
✅ Before deploying your EKS cluster you must check that your
Private subnet has the tag:
- ✨ kubernetes.io/role/internal-elb=1
and you Public subnet the tag:
- ✨ kubernetes.io/role/elb=1
Please see subnet requirements and considerations
go to directory VPC (please read the README.md)
go to directory EKS (please read the README.md)
go to directory sonarqube (please read the README.md)