Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ayush-Singhal28/dc790967a056b56103e10d5e0e40a2c4 to your computer and use it in GitHub Desktop.
Save Ayush-Singhal28/dc790967a056b56103e10d5e0e40a2c4 to your computer and use it in GitHub Desktop.
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "us-west-2"
}
terraform {
backend "s3" {
bucket = "terraform-remote-state"
key = "terraform/dev/terraform.tfstate"
region = "us-east-1"
}
}
resource "aws_instance" "aws-instance" {
count = 1
ami = "ami-a0cfeed8"
instance_type ="t2.micro"
key_name = "${var.key_name}"
connection {
user = "ec2-user"
private_key = "${file(var.private_key_path)}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment