Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resource "aws_instance" "web" {
- instance_type = "t2.micro"
- ami = "${lookup(var.aws_amis, var.aws_region)}"
- key_name = "${var.key_name}" # this is my keypair
- connection {
- type = "ssh"
- user = "${var.ssh_user}"
- }
- vpc_security_group_ids = ["${aws_security_group.default.id}"]
- subnet_id = "${aws_subnet.default.id}"
- provisioner "remote-exec" {
- inline = [
- "sudo apt-get -y update"
- ]
- }
- }
- aws_instance.web: Still creating... (5m20s elapsed)
- aws_instance.web (remote-exec): Connecting to remote host via SSH...
- aws_instance.web (remote-exec): Host: 34.250.66.198
- aws_instance.web (remote-exec): User: ubuntu
- aws_instance.web (remote-exec): Password: false
- aws_instance.web (remote-exec): Private key: false
- aws_instance.web (remote-exec): SSH Agent: true
- Error applying plan:
- 1 error(s) occurred:
- * aws_instance.web: 1 error(s) occurred:
- * timeout
- variable "aws_amis" {
- default = {
- eu-west-1 = "ami-674cbc1e"
- us-east-1 = "ami-1d4e7a66"
- us-west-1 = "ami-969ab1f6"
- us-west-2 = "ami-8803e0f0"
- }
- }
Add Comment
Please, Sign In to add comment