Closed vim-diesel closed 4 years ago
This fails to respond to any curl or browser. Image is ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200112 (ami-07ebfd5b3428b6f4d)
terraform { required_version = ">= 0.12, < 0.13" } provider "aws" { region = "us-east-1" # Allow any 2.x version of the AWS provider version = "~> 2.0" } resource "aws_instance" "example" { ami = "ami-07ebfd5b3428b6f4d" instance_type = "t2.micro" vpc_security_group_ids = [aws_security_group.instance.id] user_data = <<-EOF #!/bin/bash echo "Hello, World" > index.html nohup busybox httpd -f -p 8080 & EOF tags = { Name = "terraform-example" } } resource "aws_security_group" "instance" { name = var.security_group_name ingress { from_port = 8080 to_port = 8080 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } } variable "security_group_name" { description = "The name of the security group" type = string default = "terraform-example-instance" } output "public_ip" { value = aws_instance.example.public_ip description = "The public IP of the Instance" }
connection refused
curl http://18.234.77.22:8080 curl: (7) Failed to connect to 18.234.77.22 port 8080: Connection refused
never mind it work now.
This fails to respond to any curl or browser. Image is ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200112 (ami-07ebfd5b3428b6f4d)
connection refused