Skip to content

Commit ba66070

Browse files
committed
test terraform fix
1 parent 3b672f3 commit ba66070

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

terraform/main.tf

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
provider "aws" {
22
region = "us-east-1"
33
}
4-
5-
resource "aws_key_pair" "deployer" {
6-
key_name = "ec2"
7-
public_key = var.public_key
8-
}
9-
104
resource "aws_instance" "react_app" {
115
ami = var.ami_id
126
instance_type = var.instance_type
13-
key_name = aws_key_pair.deployer.key_name
7+
key_name = var.key_name
148
associate_public_ip_address = true
159

1610
tags = {

terraform/variables.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
variable "public_key" {
2-
type = string
3-
description = "public SSH key"
4-
}
5-
61
variable "ami_id" {
72
description = "AMI ID for EC2 (Ubuntu)"
83
default = "ami-020cba7c55df1f615"
@@ -11,4 +6,10 @@ variable "ami_id" {
116
variable "instance_type" {
127
description = "EC2 instance type"
138
default = "t2.nano"
9+
}
10+
11+
variable "key_name" {
12+
description = "Key pair name in AWS"
13+
default = "ec2"
14+
1415
}

0 commit comments

Comments
 (0)