Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add archives.jenkins.io VM #157

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions archives.jenkins.io.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
resource "digitalocean_ssh_key" "archives_jenkins_io" {
name = "Administrator Public SSH Key for archives.jenkins.io"
public_key = file("ssh/id_archives_jenkins_io.pub")
}

resource "digitalocean_volume" "archives_jenkins_io_data" {
region = var.region
name = "archives.jenkins.io-data"
size = 700
initial_filesystem_type = "ext4"
description = "Data disk for archives.jenkins.io"
}

resource "digitalocean_volume_attachment" "archives_jenkins_io_data" {
droplet_id = digitalocean_droplet.archives_jenkins_io.id
volume_id = digitalocean_volume.archives_jenkins_io_data.id
}

resource "digitalocean_droplet" "archives_jenkins_io" {
image = "ubuntu-22-04-x64"
name = "archives.jenkins.io"
region = var.region
size = "s-2vcpu-2gb"
monitoring = true
ipv6 = true
resize_disk = true
ssh_keys = [digitalocean_ssh_key.archives_jenkins_io.fingerprint]
user_data = base64encode(templatefile("${path.root}/.shared-tools/terraform/cloudinit.tftpl", { hostname = "do.archives.jenkins.io" }))

}

## Allow accessing the internet in HTTP/HTTPS/DNS and allow incoming HTTP/HTTP from anywhere (public service)
#trivy:ignore:AVD-DIG-0001 trivy:ignore:AVD-DIG-0003
resource "digitalocean_firewall" "archives_jenkins_io" {
name = "archives.jenkins.io"

droplet_ids = [digitalocean_droplet.archives_jenkins_io.id]

inbound_rule {
protocol = "tcp"
port_range = "22"
source_addresses = ["109.88.234.158/32"]
lemeurherve marked this conversation as resolved.
Show resolved Hide resolved
}

inbound_rule {
protocol = "tcp"
port_range = "80"
source_addresses = ["0.0.0.0/0", "::/0"]
}

inbound_rule {
protocol = "tcp"
port_range = "443"
source_addresses = ["0.0.0.0/0", "::/0"]
}


outbound_rule {
protocol = "tcp"
port_range = "53"
destination_addresses = ["0.0.0.0/0", "::/0"]
}

outbound_rule {
protocol = "udp"
port_range = "53"
destination_addresses = ["0.0.0.0/0", "::/0"]
}

outbound_rule {
protocol = "tcp"
port_range = "80"
destination_addresses = ["0.0.0.0/0", "::/0"]
}

outbound_rule {
protocol = "tcp"
port_range = "443"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
}
1 change: 1 addition & 0 deletions ssh/id_archives_jenkins_io.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyC+IXY8n+ea2DP5eu2ftwS2001NFsKHXEcHXmaTMdxJvtLCY2xyzS+QDb07KzjC6dwUnnfDRsYTeuuL7JxldMH7SsK/7Y+cRTOtr5X/xnaP4qDkbzgO34M14RxJogrwsDMhxaYSAZPZyrz7qvnRPlrwjeX165O6ehTRun9X44IwN5KN7sWsimhnoIaAJBEQAsvxcHe1Q1DbPNLKAnVZa5JEdgLlJWSpDDk8DNcdPO8SzV7bez0+lfuaU4fcwdYuTk25wU6A2VcD9kgfToBeGNjumSyrviOGt4O7i2f4Inzv+Pb+l7M5emZd4MjITtzrTNHzz/JtqZhYwow7ja/pz2jQetepL3nglSrvjJ9pFzPPcKm+SpRkpbYISpp3Kbxbbe00ZqH/LhTRncc1N0mdaO0KGa69HAp95dM7FOGVE5VFzT6TXsd89ud+p+/FF7qtOjPt/3yx735I73egJYBLG8KfVHiimhBUmd8TIGjTzD2dvFteR6jXif0FXcMfF7q98= [email protected]