haifa reminder ec2

This commit is contained in:
Kfir Dayan 2023-03-30 16:29:03 +03:00
commit 2dd02c8f3c
4 changed files with 80 additions and 0 deletions

40
.gitignore vendored Normal file
View file

@ -0,0 +1,40 @@
# ---> Terraform
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
*keys-vars.tf
keys
*.terraform.lock.hcl
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
.terraform.lock.hcl
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc

7
README.md Normal file
View file

@ -0,0 +1,7 @@
# kfir-infrastructure-terraform
My developing infrastructure.
Projects -
EC2 For haifa-reminder app

17
haifa-reminder-vars.tf Normal file
View file

@ -0,0 +1,17 @@
variable "instance_type" {
type = string
default = "t2.micro"
description = "EC2 instance type"
}
variable "region" {
type = string
default = "eu-central-1"
description = "AWS region"
}
variable "ami" {
type = string
default = "ami-0ec7f9846da6b0f61"
description = "AMI ID"
}

16
main.tf Normal file
View file

@ -0,0 +1,16 @@
# Path: vars/haifa-reminder.tf
provider "aws" {
region = var.region
}
// create a new EC2 instance named "haifa-reminder"
resource "aws_instance" "haifa-reminder" {
ami = var.ami
instance_type = var.instance_type
tags = {
Name = "haifa-reminder"
}
## SSH key name ##
key_name = var.terraform_key_name
}