- https://github.com/tfutils/tfenv
- https://docs.digitalocean.com/reference/doctl/how-to/install/
# https://github.com/tfutils/tfenv
tfenv install
terrafom version# https://docs.digitalocean.com/reference/doctl/how-to/install/
doctl auth init --context <NAME>
doctl auth switch --context <NAME>
doctl account getDIGITALOCEAN_ACCESS_TOKEN=$(cat $HOME/.config/doctl/config.yaml | grep "private:" | cut -d' ' -f4)
export DIGITALOCEAN_ACCESS_TOKEN=$DIGITALOCEAN_ACCESS_TOKEN
# Below should generate service_key_do & service_key_do.pub
ssh-keygen -t rsa -C "[email protected]" -f "./service_key_do"
# Load public key to DO
doctl compute ssh-key import "service_key_do" --public-key-file "service_key_do.pub"# cd infra/envs/dev/
terraform init
terraform plan -var "do_token=$DIGITALOCEAN_ACCESS_TOKEN" -out ".terraform.plan.out"
terraform apply ".terraform.plan.out"# SSH into new machine
IP_ADDRESS=$(terraform output | cut -d'"' -f2)
ssh terraform@$IP_ADDRESS -i "../../../service_key_do"
# Note. Apache2 server may be down / configuring for ~3minutes after terraform applyterraform destroy -var "do_token=$DIGITALOCEAN_ACCESS_TOKEN"https://learn.hashicorp.com/tutorials/terraform/digitalocean-provider?in=terraform/applications https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs https://www.w3schools.com/w3css/w3css_templates.asp https://docs.digitalocean.com/reference/doctl/reference/compute/region/list/
- Setup LoadBalancer
- Hide droplets into private network
- Setup DNS for LoadBalancer
- Draw diagram
- Setup DB and connect services with DB via private networks