main.tf
provider "aws" {
region = "us-east-1"
}
resource "aws_security_group" "allow_ssh" {
name = "allow_ssh_oracle_mssql_port"
description = "allow_ssh_oracle_mssql_port "
ingress {
description = "ssh-port"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = [var.my_ip]
}
ingress {
description = "Oracle-port "
from_port = 1521
to_port = 1521
protocol = "tcp"
cidr_blocks = [var.my_ip]
}
ingress {
description = "MSSQL-Port"
from_port = 1433
to_port = 1433
protocol = "tcp"
cidr_blocks = [var.my_ip]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
#ipv6_cidr_blocks = [var.my_ip]
}
tags = {
Name = "allow_imp_port_Oracle_MSSQL_ssh"
}
}
variables.tf
variable "my_ip" {
default = "34.207.6.67/32"
}
Terraform commands
terraform init
terraform plan
terraform apply
No comments:
Post a Comment