Skip to content

Instantly share code, notes, and snippets.

@cameronelliott
Last active August 25, 2021 20:44
Show Gist options
  • Save cameronelliott/9ef23e442572891937b0ed1c0c843f3f to your computer and use it in GitHub Desktop.
Save cameronelliott/9ef23e442572891937b0ed1c0c843f3f to your computer and use it in GitHub Desktop.
private_networking = false, is ignored
c@macmini ~/D/t/d/bug> terraform apply -var "do_token=$DIGITALOCEAN_ACCESS_TOKEN" -var "pvt_key=$HOME/.ssh/id_rsa" -auto-approve
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# digitalocean_droplet.www-1 will be created
+ resource "digitalocean_droplet" "www-1" {
+ backups = false
+ created_at = (known after apply)
+ disk = (known after apply)
+ id = (known after apply)
+ image = "docker-20-04"
+ ipv4_address = (known after apply)
+ ipv4_address_private = (known after apply)
+ ipv6 = false
+ ipv6_address = (known after apply)
+ locked = (known after apply)
+ memory = (known after apply)
+ monitoring = false
+ name = "www-1"
+ price_hourly = (known after apply)
+ price_monthly = (known after apply)
+ private_networking = false
+ region = "nyc3"
+ resize_disk = true
+ size = "s-1vcpu-1gb"
+ ssh_keys = [
+ "29027280",
]
+ status = (known after apply)
+ urn = (known after apply)
+ vcpus = (known after apply)
+ volume_ids = (known after apply)
+ vpc_uuid = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
digitalocean_droplet.www-1: Creating...
digitalocean_droplet.www-1: Still creating... [10s elapsed]
digitalocean_droplet.www-1: Still creating... [20s elapsed]
digitalocean_droplet.www-1: Still creating... [30s elapsed]
digitalocean_droplet.www-1: Still creating... [40s elapsed]
digitalocean_droplet.www-1: Creation complete after 44s [id=261777930]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
c@macmini ~/D/t/d/bug> terraform show|grep priv
ipv4_address_private = "10.132.0.3"
private_networking = true
c@macmini ~/D/t/d/bug>
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
variable "do_token" {}
variable "pvt_key" {}
provider "digitalocean" {
token = var.do_token
}
data "digitalocean_ssh_key" "terraform" {
name = "terraform"
}
resource "digitalocean_droplet" "www-1" {
image = "docker-20-04"
name = "www-1"
region = "nyc3"
size = "s-1vcpu-1gb"
private_networking = false
ssh_keys = [
data.digitalocean_ssh_key.terraform.id
]
connection {
host = self.ipv4_address
user = "root"
type = "ssh"
private_key = file(var.pvt_key)
timeout = "2m"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment