Skip to content

Commit

Permalink
feat: added key-pair and spot instance testing
Browse files Browse the repository at this point in the history
  • Loading branch information
theprashantyadav committed Jun 21, 2023
1 parent 4225f40 commit 887e684
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions _example/basic_example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ data "aws_iam_policy_document" "iam-policy" {
}
}

module "spot" {
module "ec2" {
source = "./../../"
name = "ec2"
environment = "test"
Expand All @@ -91,7 +91,7 @@ module "spot" {
#instance
instance_count = 1
ami = "ami-08d658f84a6d84a80"
instance_type = "t2.nano"
instance_type = "c4.xlarge"

#Networking
subnet_ids = tolist(module.public_subnets.public_subnet_id)
Expand Down
2 changes: 1 addition & 1 deletion _example/ebs_mount/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module "ec2" {
ssh_allowed_ports = [22]

#Instance
instance_count = 2
instance_count = 1
ami = "ami-08d658f84a6d84a80"
instance_type = "t2.nano"

Expand Down
2 changes: 1 addition & 1 deletion _example/spot_instance/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ data "aws_iam_policy_document" "iam-policy" {
module "spot-ec2" {
source = "./../../"
name = "ec2"
environment = "testtt"
environment = "test"
label_order = ["name", "environment"]

####----------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,4 @@ resource "aws_spot_instance_request" "default" {
private_ip,
]
}
}


}
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ variable "spot_ami" {

variable "spot_instance_count" {
type = number
default = 1
default = 0
description = "Number of instances to launch."
}

Expand All @@ -555,7 +555,7 @@ variable "spot_price" {

variable "spot_wait_for_fulfillment" {
type = bool
default = null
default = false
description = "If set, Terraform will wait for the Spot Request to be fulfilled, and will throw an error if the timeout of 10m is reached"
}

Expand Down

0 comments on commit 887e684

Please sign in to comment.