cloud-provisioning-toolkit
v1.2.4
Published
![cloud-provisioning-toolkit Logo ](./cloud-provisioning-toolkit.png)
Downloads
43
Readme
cloud-provisioning-toolkit
Cloud Provisioning Toolkit (CPT) is an open-source CLI tool built on Node.js designed to streamline the process of setting up infrastructure and CI/CD pipelines for web development projects. With CPT, developers can effortlessly bootstrap infrastructure resources on various cloud platforms and generate CI/CD pipelines to deploy their code seamlessly.
Key Features
1. Multiple Environments Provisioning
Provision both permanent environments like "prod" and "staging," as well as temporary environments for each merge request. The CLI follows the GitHub flow branching strategy, facilitating the development and deployment to multiple environments seamlessly.
2. Multi-Cloud Support
Our CLI offers diverse cloud solutions, with a primary focus on containerized applications. It caters to cloud platforms such as AWS and GCP, including support for Kubernetes and other services that facilitate Docker deployments.
3. Infrastructure as Code Integration
The CLI harnesses the power of Infrastructure as Code (IaC) tools. Currently, Pulumi is the supported IaC tool, but the CLI is designed to be extensible, making integration with other IaC tools straightforward.
4. Pipeline CI/CD
Generate a complete CI/CD pipeline that streamlines the integration and deployment of developer applications on the underlying infrastructure. Presently, the CLI leverages GitLab CI as the platform for these pipelines.
5. Supported Development Technologies
The CLI supports a broad spectrum of development technologies, including those around the Node.js runtime such as React, Angular, Node.js, and Nest.js. Additionally, it caters to technologies behind Java, encompassing Java and Spring Boot.
What CPT Generates
After running the CPT CLI, it generates the following configuration files:
Infrastructure Configuration: The CLI generates an
infra
directory containing your infrastructure configuration with Pulumi. Inside this directory, you'll find two files:pulumi.yaml
: Defines your infrastructure.pulumi.*.yaml
: Specifies the configuration for your environment.
CI/CD Pipeline Configuration: The CLI creates a
.gitlab-ci.yaml
file that defines your CI/CD pipeline.Kubernetes Deployment (Optional): If you choose Kubernetes as your deployment service, CPT generates a
k8s
directory. Inside this directory, you'll find three manifest files:deployment.yaml
service.yaml
ingress.yaml
These files streamline the provisioning of your cloud infrastructure, set up CI/CD pipelines, and, if needed, provide Kubernetes configurations.
With the infra
folder for infrastructure and the .gitlab-ci.yaml
file along with the k8s
directory for Kubernetes deployments, CPT offers a comprehensive solution to kickstart your development project.
Prerequisites
Before using the CLI, make sure you have the following prerequisites installed and configured on your system:
- Pulumi: Getting started with pulumi
- AWS CLI: Installed and authenticated to your account if you will provision services on AWS. Install AWS CLI
- gcloud CLI: Installed and authenticated to your account if you will provision services on GCP. Install gcloud CLI
Installation
Use the package manager npm to install cloud-provisioning-toolkit globally in your local system.
npm install -g cloud-provisioning-toolkit
Usage
Quickstart with CPT
To get started with the Cloud Provisioning Toolkit (CPT), follow these steps:
Initialize Your Project:
To initiate your project, use the
init
command of the CPT CLI. You can optionally pass configuration parameters for your project, such as the project name and the cloud provider. If you skip these parameters, the CLI will prompt you for the necessary and required information.
cloud-provisioning-toolkit init [--name <value>] [--cloud <GCP|AWS>]
[--stack <value>] [--location <value>] [--gcp-project <value>]
#To get the help panel of the package
cloud-provisioning-toolkit --help
#To get the help panel of the init command
cloud-provisioning-toolkit init --help
- Choose Services to Provision:
After initialization, you'll be prompted to choose the services you want to provision. Enter the required configuration parameters for each service.
- Select Deployment Service:
Once you've chosen the services to provision, the CLI will prompt you to select the deployment service for your application.
- Generate Configuration Files:
After making your choices, the CLI will generate files in the root source directory, typically including an infra directory that contains your infrastructure configuration with Pulumi and a .gitlab-ci.yml file that defines your CI/CD pipeline.
- Provision Infrastructure:
Navigate to the infra directory and run the pulumi up command to provision your infrastructure.
cd infra
pulumi up
Ensure that the operation succeeds, and your infrastructure is provisioned successfully.
- Commit and Push Code:
Finally, commit and push your code to GitLab to trigger the pipeline, which will deploy your application on the underlying infrastructure.
Now, your project is set up and ready for development and deployment with CPT. Enjoy streamlined infrastructure provisioning and CI/CD automation!
Here are an overview about the supported solutions on AWS and its configuration parameters followed by an example for each entry paramater :
Amazon Elastic Kubernetes Service (EKS) - Fargate mode:
- Cluster name : EKS cluster name (new-eks)
- Application name: Kubernetes deployment name (new-app)
- Container port : application's container port to map (3000)
- Domain name : the domain name to map for your environments, and the routing rule is based on the hostname
Amazon Elastic Container Service (ECS) - Fargate mode :
- Application name : ECS's service name (new-service)
- Container port : application's container port to map (80)
- Desired count of replicas : number of replicas for your production service (3)
Amazon Simple Service Storge (S3) Bucket:
- Bucket name : desired bucket name (new-bucket)
- Location : bucket's location (eu-west-3)
- Main page suffix : your html main page name (index.html)
- Error page suffix : your html error page name (error.html | 404.html)
- Build folder : build folder name (dist | build)
Here are an overview about the supported solutions on GCP and its configuration parameters followed by an example for each entry parameter :
Google Kubernetes Engine (GKE) - Autopilot mode:
- Cluster name : GKE cluster name (new-cluster)
- Application name : Kubernetes deployement name (new-app)
- Container port : application's container port to map (3000)
- Cluster location : desired cluster's location (europe-west9)
- Domain name : the domain name to map for your environments, and the routing rule is based on the hostname
Google Kubernetes Engine (GKE) - Standard mode:
- Cluster name : GKE cluster name (new-cluster)
- Application name : Kubernetes deployement name (new-app)
- Container port : application's container port to map (3000)
- Cluster location : desired cluster's location (europe-west9)
- Nodes number : desired number of nodes to provision for the cluster (3)
- Node machine type: desired machine type of the nodes (e2)
- Domain name : the domain name to map for your environments, and the routing rule is based on the hostname
CloudRun:
- Service name : Cloudrun service name (new-service)
- Location : desired service's location (europe-west9)
Google Storage Bucket :
- Bucket name : desired bucket name (new-bucket)
- Location : bucket's location (europe-west9)
- Main page suffix : your html main page name (index.html)
- Error page suffix : your html error page name (error.html | 404.html)
- Build folder : build folder name (dist | build)
Contributing
We welcome contributions to [CPT]! Before you get started, please review our Contribution Guidelines.
Credits
Logo created by DesignEvo logo maker
License
[CPT] is licensed under the MIT License.