Using the needed rules in security group

This commit is contained in:
butomo1989 2018-09-26 17:38:28 +02:00
parent 78b9b79212
commit c790d05e19

View file

@ -23,6 +23,7 @@ function prepare_geny_cloud() {
device=$(get_value '.device') device=$(get_value '.device')
port=$(get_value '.port') port=$(get_value '.port')
if [[ $port != null ]]; then if [[ $port != null ]]; then
echo "Starting \"$device\" with template name \"$template\" on port \"$port\"..." echo "Starting \"$device\" with template name \"$template\" on port \"$port\"..."
gmtool --cloud admin startdisposable "${template}" "${device}" --adb-serial-port "${port}" gmtool --cloud admin startdisposable "${template}" "${device}" --adb-serial-port "${port}"
@ -49,7 +50,6 @@ function prepare_geny_aws() {
android_version=$(get_value '.android_version') android_version=$(get_value '.android_version')
instance=$(get_value '.instance') instance=$(get_value '.instance')
echo $region echo $region
echo $android_version echo $android_version
echo $instance echo $instance
@ -76,19 +76,40 @@ provider "aws" {
} }
resource "aws_security_group" "geny_sg_$index" { resource "aws_security_group" "geny_sg_$index" {
provider = "aws.provider_$index" provider = "aws.provider_$index"
ingress { ingress {
from_port = 0 from_port = 22
to_port = 65535 to_port = 22
protocol = "tcp" protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"] cidr_blocks = ["0.0.0.0/0"]
description = "SSH access"
}
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "HTTP access"
}
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "HTTPS access"
}
ingress {
from_port = 51000
to_port = 51100
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
from_port = 51000
to_port = 51100
protocol = "udp"
cidr_blocks = ["0.0.0.0/0"]
} }
egress {
from_port = 0
to_port = 65535
protocol = "udp"
cidr_blocks = ["0.0.0.0/0"]
}
} }
data "aws_ami" "geny_aws_$index" { data "aws_ami" "geny_aws_$index" {