diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index a573dfb..8c8b645 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -17,5 +17,4 @@ jobs: uses: appvia/appvia-cicd-workflows/.github/workflows/terraform-module-validation.yml@main name: Module Validation with: - enable-terraform-tests: false working-directory: . diff --git a/tests/basic.tftest.hcl b/tests/module.tftest.hcl similarity index 60% rename from tests/basic.tftest.hcl rename to tests/module.tftest.hcl index 0722d39..2b31949 100644 --- a/tests/basic.tftest.hcl +++ b/tests/module.tftest.hcl @@ -1,18 +1,29 @@ mock_provider "aws" { - + mock_data "aws_availability_zones" { + defaults = { + names = [ + "eu-west-1a", + "eu-west-1b", + "eu-west-1c" + ] + } + } } -run "basic_resolver" { +run "basic" { command = plan variables { - resolver_name = "test" - resolver_vpc_id = "vpc-abc123" - - resolver_subnet_ids = [ - "subnet-abc123", - "subnet-def456", - ] + resolver_name = "test" + resolver_protocols = ["Do53"] + network = { + vpc_cidr = "10.90.0.0/21" + transit_gateway_id = "tgw-04ad8f026be8b7eb6" + } + tags = { + "Environment" = "Testing" + "GitRepo" = "https://github.com/appvia/terraform-aws-dns" + } } assert { @@ -34,9 +45,4 @@ run "basic_resolver" { condition = aws_route53_resolver_endpoint.this.resolver_endpoint_type == "IPV4" error_message = "Resolver endpoint type should be IPV4" } - - assert { - condition = aws_security_group.this.name == "${var.resolver_name}-sg" - error_message = "Expected security group name to have -sg suffix" - } }