Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot SSH into aws_instance, but the same ssh pem key allows SSH access? #2

Open
scheung38 opened this issue Mar 25, 2019 · 0 comments

Comments

@scheung38
Copy link

scheung38 commented Mar 25, 2019

Having ssh issue, why I cannot SSH into aws_instance, but the same ssh pem key allows SSH for the aws_autoscaling_group access?

resource "aws_autoscaling_group" "web" {

  name = "${aws_launch_configuration.web.name}-asg"

  min_size = 1
  desired_capacity = 2
  max_size = 3

  health_check_type = "ELB"
  load_balancers = [
    "${aws_elb.web_elb.id}"
  ]

  launch_configuration = "${aws_launch_configuration.web.name}"
  availability_zones = [
    "eu-west-2a",
    "eu-west-2b"]

  enabled_metrics = [
    "GroupMinSize",
    "GroupMaxSize",
    "GroupDesiredCapacity",
    "GroupInServiceInstances",
    "GroupTotalInstances"
  ]

  metrics_granularity = "1Minute"

  vpc_zone_identifier = [
    "${aws_subnet.public_eu_west_2a.*.id}",
    "${aws_subnet.public_eu_west_2b.*.id}"
  ]

  # Required to redeploy without an outage.
  lifecycle {
    create_before_destroy = true
  }

  tag {
    key = "Name"
    value = "AutoScaleGroup"
    propagate_at_launch = true
  }
}


resource "aws_instance" "main" {
  ami = "${lookup(var.aws_amis, var.aws_region)}"
  instance_type = "t2.micro"

  subnet_id = ""
  //vpc_security_group_ids = []

  key_name = "${aws_key_pair.auth.id}"
  tags {
    Name = "Instance"
    Use = "Demo-90PoE"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant