terraform-recipe-managing-auto-scaling-groups-and-load-balancers's People
Forkers
scheung38 baileyvw erupare tonychue moz5691 nanduk667 drewraw kalyandevop jayar15 minhlh rizi21 ajith018 liangtsao kalings-cloud manageelitech sibendu asmtal guillerecalde avimishradevops sompatil jayakumar-fleek shivlearn02 rjthapaaterraform-recipe-managing-auto-scaling-groups-and-load-balancers's Issues
No aws_instance?
Hi why there is no aws_instance? is it because this is managed by the aws_autoscaling_group?
How to migrate from ELB to NLB ?
Could you show how to thanks
Having issues with port in EC2 not open? But defined in security group?
variable "ami" {
description = "The AMI ID"
default = "ami-87848ee3"
}
variable "public_ip" {
description = "Public IP"
// default = "52.62.107.101"
default = ""
}
data "external" "whatismyip" {
program = [
"${path.module}/whatismyip.sh"]
}
resource "aws_security_group" "aws1" {
name = "Default Security Group"
description = "Allows all traffic"
ingress {
from_port = 15672
protocol = "tcp"
to_port = 15672
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 8883
protocol = "tcp"
to_port = 8883
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 5672
protocol = "tcp"
to_port = 5672
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = "${var.ssh_port}"
to_port = "${var.ssh_port}"
protocol = "tcp"
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = "${var.icmp_port}"
protocol = "icmp"
to_port = 0
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [
"0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [
"0.0.0.0/0"]
}
}
resource "aws_key_pair" "auth" {
key_name = "tls_public_key"
public_key = "${file("~/.ssh/debian9KeyPair.pub")}"
}
resource "aws_instance" "launch_instance" {
ami = "${lookup(var.aws_amis, var.aws_region)}"
instance_type = "t2.micro"
key_name = "${aws_key_pair.auth.id}"
vpc_security_group_ids = ["${aws_security_group.aws1.id}"]
// public_ip = "${var.public_ip}"
# This EC2 Instance has a public IP and will be accessible directly from the public Internet
associate_public_ip_address = true
tags {
Name = "${var.instance_name}-public"
}
}
ssh admin@variable "ami" {
description = "The AMI ID"
default = "ami-87848ee3"
}
variable "public_ip" {
description = "Public IP"
// default = "52.62.107.101"
default = ""
}
data "external" "whatismyip" {
program = [
"${path.module}/whatismyip.sh"]
}
resource "aws_security_group" "aws1" {
name = "Default Security Group"
description = "Allows all traffic"
ingress {
from_port = 15672
protocol = "tcp"
to_port = 15672
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 8883
protocol = "tcp"
to_port = 8883
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 5672
protocol = "tcp"
to_port = 5672
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = "${var.ssh_port}"
to_port = "${var.ssh_port}"
protocol = "tcp"
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = "${var.icmp_port}"
protocol = "icmp"
to_port = 0
cidr_blocks = [
"${data.external.whatismyip.result["internet_ip"]}/32"]
}
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [
"0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [
"0.0.0.0/0"]
}
}
resource "aws_key_pair" "auth" {
key_name = "tls_public_key"
public_key = "${file("~/.ssh/debian9KeyPair.pub")}"
}
resource "aws_instance" "launch_instance" {
ami = "${lookup(var.aws_amis, var.aws_region)}"
instance_type = "t2.micro"
key_name = "${aws_key_pair.auth.id}"
vpc_security_group_ids = ["${aws_security_group.aws1.id}"]
// public_ip = "${var.public_ip}"
# This EC2 Instance has a public IP and will be accessible directly from the public Internet
associate_public_ip_address = true
tags {
Name = "${var.instance_name}-public"
}
}
Then ssh into EC2 debian:
$ netstat -tunlp
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
Don't see the ports 5672, 8883, 15672?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.