To get started with the Authentication Service, follow the instructions below:
- Clone the project
- Run
npm install
to install dependencies - Create a
.env
file in the root directory of the folder and add the baseURL for frontend - Add environmental variable as the below table
- Run
npm start
in terminal to run the program
Variable | Value |
---|---|
PORT | PORT_NUMBLER |
secretOrKey | Secret_Key |
clientID | GoogleConsole_OAuth_2.0_Client_IDs |
clientSecret | GoogleConsole_OAuth_2.0_Client_Secret |
callbackURL | GoogleConsole_OAuth_2.0_callbackURL |
GITHUB_CLIENT_ID | GITHUB_Client_ID |
GITHUB_CLIENT_SECRET | GITHUB_Client_Secret |
GITHUB_CALLBACK_URL | GITHUB_CALLBACK_URL_callbackURL |
baseURL | where your frontend is hosted |
DB_URL | MONGODB_Atlas_URL |
Variable | Value |
---|---|
PORT | PORT_NUMBLER |
secretOrKey | Secret_Key |
clientID | GoogleConsole_OAuth_2.0_Client_IDs |
clientSecret | GoogleConsole_OAuth_2.0_Client_Secret |
callbackURL | GoogleConsole_OAuth_2.0_callbackURL |
This GitHub project provides a Terraform configuration to deploy an Amazon Elastic Kubernetes Service (EKS) cluster and set up an AWS CodePipeline to automate the deployment of your Kubernetes application.
Before running this Terraform project, make sure you have the following prerequisites set up:
-
AWS Account: You'll need an AWS account with appropriate permissions to create and manage resources like EKS cluster, CodePipeline, IAM roles, etc.
-
Terraform: Install Terraform on your local machine. You can download Terraform from the official website: https://www.terraform.io/downloads.html.
-
AWS CLI: Install AWS CLI (Command Line Interface) on your local machine. You can find installation instructions in the AWS CLI User Guide: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html.
-
AWS IAM Credentials: Ensure you have AWS access and secret keys configured locally. You can generate these keys by creating an IAM user with the required permissions. Make sure the IAM user has sufficient privileges to create EKS clusters and CodePipeline resources.
-
Kubernetes Tools: Install
kubectl
andaws-iam-authenticator
on your local machine to interact with the EKS cluster and authenticate with AWS IAM. Instructions for installingkubectl
can be found in the Kubernetes documentation: https://kubernetes.io/docs/tasks/tools/. Foraws-iam-authenticator
, refer to the AWS documentation: https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html.
To configure and run the Terraform project, follow these steps:
-
Clone the Repository: Clone this GitHub repository to your local machine using the
git clone
command or by downloading the repository as a ZIP file. -
Navigate to the Project Directory: In your terminal or command prompt, navigate to the project directory that contains the cloned repository.
-
Initialize Terraform: Run the following command to initialize Terraform and download the necessary provider plugins:
cd terraform terraform init
-
Configure Variables: The project requires certain variables to be configured.
Open the
variables.tf
file in a text editor and provide values for the variables. Update the variables according to your requirements. -
Review and Customize Configuration: Explore the project files and customize the configuration if needed. For example, you can modify the
eks.tf
file to adjust the EKS cluster settings. -
GitHub Repository Details: Open the
codepipeline.tf
file in a text editor. Inside thesource
stage, add or update the following attributes:BranchName
: Replace<GITHUB_REPO>
with the name of your GitHub repository.FullRepositoryId
: Replace<BRANCH_NAME>
with the branch you want to trigger the pipeline on.ConnectionArn
: Replace<CONNECTION_ARN>
with the ARN of the connection you want to use. This connection should be previously established using the AWS CodePipeline console or the AWS CLI.
configuration = { BranchName = <BRANCH_NAME> FullRepositoryId = <GITHUB_REPO> ConnectionArn = <CONNECTION_ARN> } ...
After completing these steps, your codepipeline.tf
file should include the GitHub repository details and the ConnectionArn required for the AWS CodePipeline resource to function correctly.
-
Plan and Verify Changes: Run the following command to preview the changes Terraform will make to your infrastructure:
terraform plan
Review the output to ensure the changes align with your expectations.
-
Deploy the Infrastructure: Run the following command to deploy the infrastructure defined in the Terraform configuration:
terraform apply
Confirm the deployment by typing
yes
when prompted. Terraform will create the EKS cluster, associated resources, and the CodePipeline.