Last active
November 7, 2022 10:53
-
-
Save gilacost/4dc06625bae6ec04793d89390876b432 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### Terraform file named main.tf ######## | |
provider "digitalocean" {} | |
module "do-droplet" { | |
source = "git::[email protected]:gilacost/terraform-modules.git//services/do-droplet?ref=v0.0.1" | |
droplet_image_slug = "ghost-18-04" | |
domain_name = "your.domain" | |
ssh_local_key_path = "~/.ssh/id_rsa.pub" | |
region = "fra1" | |
} | |
output "ipv4_address" { | |
value = module.do-droplet.ipv4_address | |
} | |
######### Terraform file named main.tf ######## | |
######### Terraform comands in shell ########## | |
terraform init | |
terraform apply | |
######### Terraform comands in shell ########## | |
######### generating ssh key ########## | |
ssh-keygen -t rsa | |
######### generating ssh key ########## | |
######### DO API ########### | |
curl -X GET \ | |
-H "Content-Type: application/json"\ | |
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\ | |
"https://api.digitalocean.com/v2/images?per_page=999" |jq |grep ghost | |
curl -X GET \ | |
-H "Content-Type: application/json"\ | |
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\ | |
"https://api.digitalocean.com/v2/regions?per_page=999" |jq '.regions[] | .slug' | |
######### DO API ########### | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment