Loading repository data…
Loading repository data…
D10S0VSkY-OSS / repository
OpenSource self-service infrastructure solution that defines and manages the complete lifecycle of resources used and provisioned into a cloud! It is a terraform UI with rest api for terraform and OpenTofu automation
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url]
SLD helps to accelerate deployment, weighting and making IaaC reusable, generating dynamic forms and maintaining different variables in each environment with the same code. With SLD you can schedule infrastructure deployments like its destruction, manage users by roles and separate stacks by squad and environment
Main features:
SLD is the easy way to use your terrafrom code!
You need docker and docker-compse or kind ( recomended ).
Clone the SLD repo
git clone https://github.com/D10S0VSkY-OSS/Stack-Lifecycle-Deployment.git
cd Stack-Lifecycle-Deployment
Install CLI dependencies
pip install -r requirements.txt
Start SLD with a single command
python sld_cli.py start
The CLI will:
Result:
🚀 Starting SLD deployment...
✓ Checking prerequisites...
✓ Creating Kind cluster...
✓ Deploying SLD services...
✓ Initializing admin user...
#################################################
# Now, you can play with SLD 🕹️ #
#################################################
API: http://localhost:8000/docs
DASHBOARD: http://localhost:5000/
---------------------------------------------
username: admin
password: Password08@
---------------------------------------------
Other CLI commands:
python sld_cli.py status # Check deployment status
python sld_cli.py stop # Stop all services
python sld_cli.py restart # Restart services
python sld_cli.py logs # View logs
Clone the SLD repo
git clone https://github.com/D10S0VSkY-OSS/Stack-Lifecycle-Deployment.git
cd Stack-Lifecycle-Deployment
Install CLI dependencies
pip install -r requirements.txt
Deploy SLD in k8s with kind
python sld_cli.py start -m k8s
Result:
🚀 Starting SLD deployment in Kubernetes mode...
✓ Checking prerequisites...
✓ Creating Kind cluster...
✓ Deploying SLD services...
✓ Initializing admin user...
#################################################
# Now, you can play with SLD 🕹️ #
#################################################
API: http://localhost:8000/docs
DASHBOARD: http://localhost:5000/
---------------------------------------------
username: admin
password: Password08@
---------------------------------------------
Other Kubernetes commands:
python sld_cli.py status -m k8s # Check deployment status
python sld_cli.py stop -m k8s # Stop all services
python sld_cli.py restart -m k8s # Restart services
python sld_cli.py logs -m k8s # View logs
Sign-in to DASHBOARD:
Click the dashboard link:
Add Cloud account
fill in the form with the required data. in our example we will use
by default workers are running as squad1 and squad2 for play purpose, but you can change it and scale when you want
When you add an account to a provider ( aws, gcp, azure ) one squad is created, you must create a worker for the name of the created squad, if you don't do it the deployment will remain in a "PENDING" state Read Workers
finally add:
Add terraform module or stack
Prefixs supported: aws_ , gcp_, azure_
You can pass user and password as https://username:password@github.com/aws_vpc For ssh you can pass it as a secret in the deployment to the user sld
'*' = gives access to all, you can allow access to one or many squads separated by commas: squad1,squad2
Deploy your first stack!!!
List stacks for deploy
Choose deploy
SLD will generate a dynamic form based on the stack variables, fill in the form and press the Deploy button
Important! assign the same squad and environment that we previously created when adding the account (See Add Cloud account)
Now, the status of the task will change as the deployment progresses.
You can control the implementation life cycle You can destroy, re-implement that SLD will keep the old values or you can also edit those values at will. And finally you can manage the life cycle programmatically, handle the destruction / creation of the infrastructure, a good practice for the savings plan!!!
SLD uses its own remote backend, so you don't need to configure any backend in terraform. The following example shows a backend config
terraform {
backend "http" {
address = "http://remote-state:8080/terraform_state/aws_vpc-squad1-develop-vpc_core"
lock_address = "http://remote-state:8080/terraform_lock/aws_vpc-squad1-develop-vpc_core"
lock_method = "PUT"
unlock_address = "http://remote-state:8080/terraform_lock/aws_vpc-squad1-develop-vpc_core"
unlock_method = "DELETE"
}
}
At the moment SLD supports MongoDB, S3 and local backend (for testing purposes only) To configure MongoDB as a backend, you must pass the following variables as parameters to the remote-state service:
# docker-compose.yaml
environment:
SLD_STORE: mongodb
SLD_MONGODB_URL: "mongodb:27017/"
MONGODB_USER: admin
MONGODB_PASSWD: admin
# k8s yaml
env:
- name: SLD_STORE
value: mongodb
- name: SLD_MONGODB_URL
value: "mongodb:27017/"
- name: MONGODB_USER
value: admin
- name: MONGODB_PASSWD
value: admin
To configure S3 you can pass the access and secret keys of aws, in case SLD is running in AWS it is recommended to use roles
env:
- name: SLD_STORE
value: "S3"
- name: SLD_BUCKET
value: "s3-sld-backend-cloud-tf-state"
- name: AWS_ACCESS_KEY
value: ""
- name: AWS_SECRET_ACCESS_KEY
value: ""
For Azure env you need set the next env
env:
- name: SLD_STORE
value: azure
- name: AZURE_STORAGE_CONNECTION_STRING
value: "DefaultEndpointsProtocol=https;AccountName=<YOUR ACCOUNT>;AccountKey=<YOUR ACCESS KEY>;EndpointSuffix=core.windows.net"
For google cloud storage set:
SLD_STORE=gcp
export GOOGLE_APPLICATION_CREDENTIALS="/app/sld-gcp-credentials.json"
Import google service account key to k8s secret
kubectl create secret generic gcp-storage --from-file=~/Downloads/storage.json
Modify sld-remote-state.yml set gcp storage cloud backend and mount secret:
apiVersion: apps/v1
kind: Deployment
metadata:
name: remote-state