From c35e81d6e3ad91eec51d1bddacb9be4a6661be05 Mon Sep 17 00:00:00 2001 From: Conor McManus Date: Thu, 5 Jan 2023 14:36:42 +0100 Subject: [PATCH] Open ssh port for all --- broadcast.tf | 16 ++++++++-------- dns.tf | 2 +- main.tf | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/broadcast.tf b/broadcast.tf index b524d2a..ea711fe 100644 --- a/broadcast.tf +++ b/broadcast.tf @@ -2,14 +2,14 @@ resource "aws_instance" "broadcast" { ami = "${data.aws_ami.image.id}" instance_type = "t3.medium" key_name = "jamulus" - security_groups = [ aws_security_group.ssh.name, aws_security_group.broadcast.name, aws_security_group.node-exporter.name ] # Add your own IP to this group + security_groups = [aws_security_group.ssh.name, aws_security_group.broadcast.name, aws_security_group.node-exporter.name] # Add your own IP to this group provisioner "remote-exec" { inline = ["sudo apt update", "sudo apt install python3 -y", "echo Done!"] connection { - type = "ssh" - user = "ubuntu" - host = self.public_ip + type = "ssh" + user = "ubuntu" + host = self.public_ip private_key = file("${path.module}/jamulus.pem") } } @@ -33,7 +33,7 @@ resource "aws_security_group_rule" "icecast" { to_port = 8000 from_port = 8000 protocol = "tcp" - cidr_blocks = [ "0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.broadcast.id } @@ -42,7 +42,7 @@ resource "aws_security_group_rule" "rtmp-1" { to_port = 8554 from_port = 8554 protocol = "udp" - cidr_blocks = [ "0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.broadcast.id } @@ -51,7 +51,7 @@ resource "aws_security_group_rule" "rtmp-2" { to_port = 1935 from_port = 1935 protocol = "tcp" - cidr_blocks = [ "0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.broadcast.id } @@ -60,6 +60,6 @@ resource "aws_security_group_rule" "rtmp-3" { to_port = 8888 from_port = 8888 protocol = "tcp" - cidr_blocks = [ "0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.broadcast.id } \ No newline at end of file diff --git a/dns.tf b/dns.tf index e3898ac..2c6ab08 100644 --- a/dns.tf +++ b/dns.tf @@ -1,7 +1,7 @@ terraform { required_providers { digitalocean = { - source = "digitalocean/digitalocean" + source = "digitalocean/digitalocean" version = "~> 2.0" } } diff --git a/main.tf b/main.tf index 0083c7e..42a95f9 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ provider "aws" { - region = "eu-west-2" + region = "eu-west-2" } terraform { @@ -14,14 +14,14 @@ resource "aws_instance" "jamulus" { ami = "${data.aws_ami.image.id}" instance_type = "t3.medium" key_name = "jamulus" - security_groups = [ aws_security_group.ssh.name, aws_security_group.jamulus.name, aws_security_group.node-exporter.name ] # Add your own IP to this group + security_groups = [aws_security_group.ssh.name, aws_security_group.jamulus.name, aws_security_group.node-exporter.name] # Add your own IP to this group provisioner "remote-exec" { inline = ["sudo apt update", "sudo apt install python3 -y", "echo Done!"] connection { - type = "ssh" - user = "ubuntu" - host = self.public_ip + type = "ssh" + user = "ubuntu" + host = self.public_ip private_key = file("${path.module}/jamulus.pem") } } @@ -67,7 +67,7 @@ resource "aws_security_group_rule" "ssh" { to_port = 22 from_port = 22 protocol = "tcp" - cidr_blocks = [ "${chomp(data.http.myip.body)}/32" ] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.ssh.id } @@ -82,7 +82,7 @@ resource "aws_security_group_rule" "jamulus" { to_port = 22124 from_port = 22124 protocol = "udp" - cidr_blocks = [ "0.0.0.0/0"] + cidr_blocks = ["0.0.0.0/0"] security_group_id = aws_security_group.jamulus.id } @@ -96,7 +96,7 @@ resource "aws_security_group_rule" "node-exporter" { to_port = 9100 from_port = 9100 protocol = "tcp" - cidr_blocks = [ "142.132.191.61/32"] + cidr_blocks = ["142.132.191.61/32"] security_group_id = aws_security_group.node-exporter.id } @@ -107,4 +107,4 @@ output "jamulus_ip" { output "broadcast_ip" { value = "${aws_instance.broadcast.public_ip}" -} \ No newline at end of file +}