Skip to content

Commit

Permalink
feat(redis): graviton instance test case (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-ook authored Aug 29, 2023
1 parent edd3d04 commit 3d77dbc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions modules/redis/tests/graviton/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
terraform {
required_providers {
test = {
source = "terraform.io/builtin/test"
}
}
}

module "vpc" {
source = "Young-ook/vpc/aws"
version = "1.0.5"
}

module "main" {
source = "../.."
vpc = module.vpc.vpc.id
subnets = values(module.vpc.subnets["public"])
cluster = {
password = "supersuperSecr0et"
instance_type = "cache.m6g.large"
}
}

resource "test_assertions" "pet_name" {
component = "pet_name"
check "pet_name" {
description = "default random pet name"
condition = can(length(regexall("^redis", module.main.cluster.id)) > 0)
}
}

resource "test_assertions" "password" {
component = "password"
check "custom_password" {
description = "custom password"
condition = module.main.user.password == "supersuperSecr0et" ? true : false
}
}

0 comments on commit 3d77dbc

Please sign in to comment.