Skip to content

Instantly share code, notes, and snippets.

@gilacost
Last active November 7, 2022 10:53
Show Gist options
  • Save gilacost/4dc06625bae6ec04793d89390876b432 to your computer and use it in GitHub Desktop.
Save gilacost/4dc06625bae6ec04793d89390876b432 to your computer and use it in GitHub Desktop.
######### Terraform file named main.tf ########
provider "digitalocean" {}
module "do-droplet" {
source = "git::git@github.com: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