examples: remove digitalocean example
This has now moved into the digitalocean provider repository, linked from the README here.
This commit is contained in:
parent
590bbe9b31
commit
d32a0e8e1f
|
@ -22,4 +22,5 @@ repositories contain documentation specific to their provider:
|
||||||
* [Azure Examples](https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples)
|
* [Azure Examples](https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples)
|
||||||
* [CenturyLink Cloud Examples](https://github.com/terraform-providers/terraform-provider-clc/tree/master/examples)
|
* [CenturyLink Cloud Examples](https://github.com/terraform-providers/terraform-provider-clc/tree/master/examples)
|
||||||
* [Consul Examples](https://github.com/terraform-providers/terraform-provider-consul/tree/master/examples)
|
* [Consul Examples](https://github.com/terraform-providers/terraform-provider-consul/tree/master/examples)
|
||||||
|
* [DigitalOcean Examples](https://github.com/terraform-providers/terraform-provider-digitalocean/tree/master/examples)
|
||||||
* [Google Cloud Examples](https://github.com/terraform-providers/terraform-provider-google/tree/master/examples)
|
* [Google Cloud Examples](https://github.com/terraform-providers/terraform-provider-google/tree/master/examples)
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Digital Ocean Droplet launch and setting the Domain records at Digital Ocean.
|
|
||||||
|
|
||||||
The example launches an Ubuntu 16.04, runs apt-get update and installs nginx. Also demonstrates how to create DNS records under Domains at DigitalOcean.
|
|
||||||
|
|
||||||
To run, configure your Digital Ocean provider as described in https://www.terraform.io/docs/providers/do/index.html
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
You need to export you DigitalOcean API Token as an environment variable
|
|
||||||
|
|
||||||
export DIGITALOCEAN_TOKEN="Put Your Token Here"
|
|
||||||
|
|
||||||
## Run this example using:
|
|
||||||
|
|
||||||
terraform plan
|
|
||||||
terraform apply
|
|
|
@ -1,44 +0,0 @@
|
||||||
provider "digitalocean" {
|
|
||||||
# You need to set this in your .bashrc
|
|
||||||
# export DIGITALOCEAN_TOKEN="Your API TOKEN"
|
|
||||||
#
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "digitalocean_droplet" "mywebserver" {
|
|
||||||
# Obtain your ssh_key id number via your account. See Document https://developers.digitalocean.com/documentation/v2/#list-all-keys
|
|
||||||
ssh_keys = [12345678] # Key example
|
|
||||||
image = "${var.ubuntu}"
|
|
||||||
region = "${var.do_ams3}"
|
|
||||||
size = "512mb"
|
|
||||||
private_networking = true
|
|
||||||
backups = true
|
|
||||||
ipv6 = true
|
|
||||||
name = "mywebserver-ams3"
|
|
||||||
|
|
||||||
provisioner "remote-exec" {
|
|
||||||
inline = [
|
|
||||||
"export PATH=$PATH:/usr/bin",
|
|
||||||
"sudo apt-get update",
|
|
||||||
"sudo apt-get -y install nginx",
|
|
||||||
]
|
|
||||||
|
|
||||||
connection {
|
|
||||||
type = "ssh"
|
|
||||||
private_key = "${file("~/.ssh/id_rsa")}"
|
|
||||||
user = "root"
|
|
||||||
timeout = "2m"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "digitalocean_domain" "mywebserver" {
|
|
||||||
name = "www.mywebserver.com"
|
|
||||||
ip_address = "${digitalocean_droplet.mywebserver.ipv4_address}"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "digitalocean_record" "mywebserver" {
|
|
||||||
domain = "${digitalocean_domain.mywebserver.name}"
|
|
||||||
type = "A"
|
|
||||||
name = "mywebserver"
|
|
||||||
value = "${digitalocean_droplet.mywebserver.ipv4_address}"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
output "Public ip" {
|
|
||||||
value = "${digitalocean_droplet.mywebserver.ipv4_address}"
|
|
||||||
}
|
|
||||||
|
|
||||||
output "Name" {
|
|
||||||
value = "${digitalocean_droplet.mywebserver.name}"
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
# ####
|
|
||||||
|
|
||||||
# Current Available Datacenter Regions
|
|
||||||
|
|
||||||
# As of 28-05-2017
|
|
||||||
|
|
||||||
#
|
|
||||||
|
|
||||||
variable "do_ams2" {
|
|
||||||
description = "Digital Ocean Amsterdam Data Center 2"
|
|
||||||
default = "ams2"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_ams3" {
|
|
||||||
description = "Digital Ocean Amsterdam Data Center 3"
|
|
||||||
default = "ams3"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_blr1" {
|
|
||||||
description = "Digital Ocean Bangalore Data Center 1"
|
|
||||||
default = "blr1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_fra1" {
|
|
||||||
description = "Digital Ocean Frankfurt Data Center 1"
|
|
||||||
default = "fra1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_lon1" {
|
|
||||||
description = "Digital Ocean London Data Center 1"
|
|
||||||
default = "lon1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_nyc1" {
|
|
||||||
description = "Digital Ocean New York Data Center 1"
|
|
||||||
default = "nyc1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_nyc2" {
|
|
||||||
description = "Digital Ocean New York Data Center 2"
|
|
||||||
default = "nyc2"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_nyc3" {
|
|
||||||
description = "Digital Ocean New York Data Center 3"
|
|
||||||
default = "nyc3"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_sfo1" {
|
|
||||||
description = "Digital Ocean San Francisco Data Center 1"
|
|
||||||
default = "sfo1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_sgp1" {
|
|
||||||
description = "Digital Ocean Singapore Data Center 1"
|
|
||||||
default = "sgp1"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "do_tor1" {
|
|
||||||
description = "Digital Ocean Toronto Datacenter 1"
|
|
||||||
default = "tor1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Default Os
|
|
||||||
|
|
||||||
variable "ubuntu" {
|
|
||||||
description = "Default LTS"
|
|
||||||
default = "ubuntu-16-04-x64"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "centos" {
|
|
||||||
description = "Default Centos"
|
|
||||||
default = "centos-72-x64"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "coreos" {
|
|
||||||
description = "Defaut Coreos"
|
|
||||||
default = "coreos-899.17.0"
|
|
||||||
}
|
|
Loading…
Reference in New Issue