Need to add some more featuresprovider "aws" {
access_key = "AKIATVAAAHHYOLXZ3V4A"
secret_key = "2+b3d/5h4xaHBVgrkXnuOtdDKobPmVhp8B2Fgp03"
region = "us-east-1"
}
from_port = 443
to_port = 443
protocol = "tcp"
# Please restrict your ingress to only necessary IPs and ports.
# Opening to 0.0.0.0/0 can lead to security vulnerabilities.
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
TLS (change to whatever ports you need)
from_port = 80
to_port = 80
protocol = "tcp"
# Please restrict your ingress to only necessary IPs and ports.
# Opening to 0.0.0.0/0 can lead to security vulnerabilities.
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
# TLS (change to whatever ports you need)
from_port = 8080
to_port = 8080
protocol = "tcp"
# Please restrict your ingress to only necessary IPs and ports.
# Opening to 0.0.0.0/0 can lead to security vulnerabilities.
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
TLS (change to whatever ports you need)
from_port = 22
to_port = 22
protocol = "tcp"
# Please restrict your ingress to only necessary IPs and ports.
# Opening to 0.0.0.0/0 can lead to security vulnerabilities.
cidr_blocks = ["0.0.0.0/0"]
Need to add some more featuresprovider "aws" { access_key = "AKIATVAAAHHYOLXZ3V4A" secret_key = "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" region = "us-east-1" }
resource "aws_security_group" "allow_tls" { name = "allow_Jenkins2" description = "Allow Jenkins inbound traffic" vpc_id = "vpc-0c88e8b230dae4cd8"
ingress {
TLS (change to whatever ports you need)
}
ingress {
TLS (change to whatever ports you need)
}
}
ingress {
TLS (change to whatever ports you need)
}
egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] }
tags = { Name = "allow_all" } }
Resource Configuration for AWS
resource "aws_instance" "MyFirstTerraServer" { ami = "ami-cfe4b2b0" instance_type = "t2.micro" key_name = "NewWebserver"
vpc_security_group_ids = ["${aws_security_group.allow_tls.name}"]
subnet_id ="subnet-08f1d1c2b068f6f29" tags = { Name = "Jenkins_Class" } }