Skip to content

Commit

Permalink
nil hil
Browse files Browse the repository at this point in the history
  • Loading branch information
LamSut committed Nov 3, 2024
1 parent e91145e commit f6934a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 5 additions & 2 deletions tests/backend.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ variables {
//more
}

run "backend_tests" {
run "bucket_tests" {
command = plan

assert {
condition = var.bucket == "b2111933-bucket"
error_message = "Not our bucket!"
}
}

run "dynamodb_table_tests" {
command = plan
assert {
condition = var.dynamodb_table == "b2111933-table"
error_message = "Not our table!"
}
}

14 changes: 9 additions & 5 deletions tests/freeEC2.tftest.hcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
variables {
ami_amazon_linux_2023 = "ami-06b21ccaeff8cd686"
ami_amazon_linux_hvm = "ami-0ddc798b3f1a5117e"
ami_amazon_linux_2023 = "ami-06b21ccaeff8cd686"
ami_ubuntu_server_24_04 = "ami-0866a3c8686eaeeba"
ami_ms_windows_server_2022 = "ami-0324a83b82023f0b3"
//more ami

instance_type = "t2.micro"
//more instace type
}

run "ec2_tests" {
run "ami_tests" {
command = plan

assert {
condition = module.ec2.ami == var.ami_amazon_linux_2023 || module.ec2.ami == var.ami_amazon_linux_hvm
condition = module.ec2.ami == var.ami_amazon_linux_2023 || module.ec2.ami == var.ami_ubuntu_server_24_04 || module.ec2.ami == var.ami_ms_windows_server_2022
error_message = "Invalid or not a free AMI type!"
}
}

run "instance_type_tests" {
command = plan
assert {
condition = module.ec2.instance_type == var.instance_type
error_message = "Invalid or not a free instance type!"
Expand Down

0 comments on commit f6934a4

Please sign in to comment.