Guest User

Untitled

a guest
Oct 29th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. resource "aws_instance" "web" {
  2. instance_type = "t2.micro"
  3. ami = "${lookup(var.aws_amis, var.aws_region)}"
  4.  
  5. key_name = "${var.key_name}" # this is my keypair
  6. connection {
  7. type = "ssh"
  8. user = "${var.ssh_user}"
  9. }
  10. vpc_security_group_ids = ["${aws_security_group.default.id}"]
  11. subnet_id = "${aws_subnet.default.id}"
  12. provisioner "remote-exec" {
  13. inline = [
  14. "sudo apt-get -y update"
  15. ]
  16. }
  17. }
  18.  
  19. aws_instance.web: Still creating... (5m20s elapsed)
  20. aws_instance.web (remote-exec): Connecting to remote host via SSH...
  21. aws_instance.web (remote-exec): Host: 34.250.66.198
  22. aws_instance.web (remote-exec): User: ubuntu
  23. aws_instance.web (remote-exec): Password: false
  24. aws_instance.web (remote-exec): Private key: false
  25. aws_instance.web (remote-exec): SSH Agent: true
  26. Error applying plan:
  27.  
  28. 1 error(s) occurred:
  29.  
  30. * aws_instance.web: 1 error(s) occurred:
  31.  
  32. * timeout
  33.  
  34. variable "aws_amis" {
  35. default = {
  36. eu-west-1 = "ami-674cbc1e"
  37. us-east-1 = "ami-1d4e7a66"
  38. us-west-1 = "ami-969ab1f6"
  39. us-west-2 = "ami-8803e0f0"
  40. }
  41. }
Add Comment
Please, Sign In to add comment