diff --git a/examples/README.md b/examples/README.md index 02165851e..49cafd8f5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -22,4 +22,5 @@ repositories contain documentation specific to their provider: * [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) * [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) diff --git a/examples/digitalocean/README.md b/examples/digitalocean/README.md deleted file mode 100644 index 4a349b02b..000000000 --- a/examples/digitalocean/README.md +++ /dev/null @@ -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 diff --git a/examples/digitalocean/main.tf b/examples/digitalocean/main.tf deleted file mode 100644 index 3572ac06b..000000000 --- a/examples/digitalocean/main.tf +++ /dev/null @@ -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}" -} diff --git a/examples/digitalocean/outputs.tf b/examples/digitalocean/outputs.tf deleted file mode 100644 index 8c7e627ac..000000000 --- a/examples/digitalocean/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "Public ip" { - value = "${digitalocean_droplet.mywebserver.ipv4_address}" -} - -output "Name" { - value = "${digitalocean_droplet.mywebserver.name}" -} diff --git a/examples/digitalocean/variable.tf b/examples/digitalocean/variable.tf deleted file mode 100644 index bffd17fca..000000000 --- a/examples/digitalocean/variable.tf +++ /dev/null @@ -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" -}