-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.terraform |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Exportamos nuestra key SSH | ||
|
||
resource "digitalocean_ssh_key" "pelado" { | ||
name = "pelado" | ||
public_key = "${file("id_rsa.pub")}" | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Creamos el droplet | ||
|
||
resource "digitalocean_droplet" "web" { | ||
image = "ubuntu-18-04-x64" | ||
name = "web-1" | ||
region = "nyc1" | ||
size = "s-1vcpu-1gb" | ||
user_data = "${file("userdata.yaml")}" | ||
ssh_keys = ["${digitalocean_ssh_key.pelado.fingerprint}"] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Creamos un dominio nuevo | ||
|
||
resource "digitalocean_domain" "pablokbs" { | ||
name = "pablokbs.com" | ||
} | ||
|
||
# Add a record to the domain | ||
resource "digitalocean_record" "www" { | ||
domain = "${digitalocean_domain.pablokbs.name}" | ||
type = "A" | ||
name = "pelado" | ||
ttl = "10" | ||
value = "${digitalocean_droplet.web.ipv4_address}" | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variable "digitalocean_token" {} | ||
|
||
# Configure the DigitalOcean Provider | ||
provider "digitalocean" { | ||
token = "${var.digitalocean_token}" | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeBNiMcymqStf/htH+Hwb1HkTM3lrQ+guCt9pC6SZm66nMys3Pun6SqlPoBDyObRNRzYKe57pxga3W2O0UE+puiGoICDK/XhJ2kSchJQLCpl1Cb+57tAez6vO46sLVrG4pdyKpOmYJrsCwt0zw0z4rIKr7Gm43Mr+GBLrDBdFz6UXArsSzazPihb1ySI3OdH01zCgenJC8lIO2V+4kvYzvzXZIng24SlO1Eoz0W/p/AF+HtzseKGoPXMYaxq9Mbu6jtlpFOuzmYsl3xQUP1nbFUqEKsozfMnjLA/1uGTV7AFKS9o6aIQ4Zz4Hg8gBWhTBmwV6W3hzW8k/MPlsIeGhZ kbs@Pablo-Fredrikson |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": 3, | ||
"terraform_version": "0.11.11", | ||
"serial": 6, | ||
"lineage": "0610b8b6-9b75-9900-7f3c-b20e2c57db84", | ||
"modules": [ | ||
{ | ||
"path": [ | ||
"root" | ||
], | ||
"outputs": {}, | ||
"resources": {}, | ||
"depends_on": [] | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"version": 3, | ||
"terraform_version": "0.11.11", | ||
"serial": 6, | ||
"lineage": "0610b8b6-9b75-9900-7f3c-b20e2c57db84", | ||
"modules": [ | ||
{ | ||
"path": [ | ||
"root" | ||
], | ||
"outputs": {}, | ||
"resources": { | ||
"digitalocean_domain.pablokbs": { | ||
"type": "digitalocean_domain", | ||
"depends_on": [], | ||
"primary": { | ||
"id": "pablokbs.com", | ||
"attributes": { | ||
"id": "pablokbs.com", | ||
"name": "pablokbs.com" | ||
}, | ||
"meta": {}, | ||
"tainted": false | ||
}, | ||
"deposed": [], | ||
"provider": "provider.digitalocean" | ||
}, | ||
"digitalocean_droplet.web": { | ||
"type": "digitalocean_droplet", | ||
"depends_on": [ | ||
"digitalocean_ssh_key.pelado" | ||
], | ||
"primary": { | ||
"id": "133993070", | ||
"attributes": { | ||
"backups": "false", | ||
"disk": "25", | ||
"id": "133993070", | ||
"image": "ubuntu-18-04-x64", | ||
"ipv4_address": "167.99.237.45", | ||
"ipv4_address_private": "", | ||
"ipv6": "false", | ||
"ipv6_address": "", | ||
"ipv6_address_private": "", | ||
"locked": "false", | ||
"memory": "1024", | ||
"monitoring": "false", | ||
"name": "web-1", | ||
"price_hourly": "0.00744", | ||
"price_monthly": "5", | ||
"private_networking": "false", | ||
"region": "nyc1", | ||
"resize_disk": "true", | ||
"size": "s-1vcpu-1gb", | ||
"ssh_keys.#": "1", | ||
"ssh_keys.682625310": "43:7e:e4:d9:8e:96:a0:cb:af:4a:ef:fb:68:26:a7:af", | ||
"status": "active", | ||
"tags.#": "0", | ||
"user_data": "4cce4e6a366e58cb95dc5f1079d554a9c147a9b6", | ||
"vcpus": "1", | ||
"volume_ids.#": "0" | ||
}, | ||
"meta": { | ||
"schema_version": "1" | ||
}, | ||
"tainted": false | ||
}, | ||
"deposed": [], | ||
"provider": "provider.digitalocean" | ||
}, | ||
"digitalocean_record.www": { | ||
"type": "digitalocean_record", | ||
"depends_on": [ | ||
"digitalocean_domain.pablokbs", | ||
"digitalocean_droplet.web" | ||
], | ||
"primary": { | ||
"id": "65969208", | ||
"attributes": { | ||
"domain": "pablokbs.com", | ||
"flags": "0", | ||
"fqdn": "pelado.pablokbs.com", | ||
"id": "65969208", | ||
"name": "pelado", | ||
"port": "0", | ||
"priority": "0", | ||
"tag": "", | ||
"ttl": "10", | ||
"type": "A", | ||
"value": "167.99.237.45", | ||
"weight": "0" | ||
}, | ||
"meta": {}, | ||
"tainted": false | ||
}, | ||
"deposed": [], | ||
"provider": "provider.digitalocean" | ||
}, | ||
"digitalocean_ssh_key.pelado": { | ||
"type": "digitalocean_ssh_key", | ||
"depends_on": [], | ||
"primary": { | ||
"id": "24088717", | ||
"attributes": { | ||
"fingerprint": "43:7e:e4:d9:8e:96:a0:cb:af:4a:ef:fb:68:26:a7:af", | ||
"id": "24088717", | ||
"name": "pelado", | ||
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeBNiMcymqStf/htH+Hwb1HkTM3lrQ+guCt9pC6SZm66nMys3Pun6SqlPoBDyObRNRzYKe57pxga3W2O0UE+puiGoICDK/XhJ2kSchJQLCpl1Cb+57tAez6vO46sLVrG4pdyKpOmYJrsCwt0zw0z4rIKr7Gm43Mr+GBLrDBdFz6UXArsSzazPihb1ySI3OdH01zCgenJC8lIO2V+4kvYzvzXZIng24SlO1Eoz0W/p/AF+HtzseKGoPXMYaxq9Mbu6jtlpFOuzmYsl3xQUP1nbFUqEKsozfMnjLA/1uGTV7AFKS9o6aIQ4Zz4Hg8gBWhTBmwV6W3hzW8k/MPlsIeGhZ kbs@Pablo-Fredrikson" | ||
}, | ||
"meta": {}, | ||
"tainted": false | ||
}, | ||
"deposed": [], | ||
"provider": "provider.digitalocean" | ||
} | ||
}, | ||
"depends_on": [] | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#cloud-config | ||
package_update: true | ||
packages: | ||
- docker.io | ||
write_files: | ||
- path: /root/index.html | ||
content: | | ||
Sos un capo de terraform | ||
runcmd: | ||
- docker run -d -v /root/index.html:/usr/share/nginx/html/index.html -p 80:80 nginx |