Task: Create two AWS Chime Voice Connectors, both with encryption. Then create an aws_chime_voice_connector_group resource with both of these connectors. One connector should be prioritized over the other.

Specification:
Has one resource "aws_chime_voice_connector"
with require_encryption="true"

Has another resource "aws_chime_voice_connector"
with require_encryption="true"

Has one resource "aws_chime_voice_connector_group"
with a connector for each voice connector with the correct id
one connector should have a priority higher than the other

Terraform configuration (main.tf):
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

resource "aws_chime_voice_connector" "vc1" {
  name               = "connector-test-1"
  require_encryption = true
  aws_region         = "us-east-1"
}

resource "aws_chime_voice_connector" "vc2" {
  name               = "connector-test-2"
  require_encryption = true
  aws_region         = "us-west-2"
}

resource "aws_chime_voice_connector_group" "group" {
  name = "test-group"

  connector {
    voice_connector_id = aws_chime_voice_connector.vc1.id
    priority           = 1
  }

  connector {
    voice_connector_id = aws_chime_voice_connector.vc2.id
    priority           = 3
  }
}

Validation policy (checks.rego):
package aws_chime_voice_connector
import future.keywords.in

default valid := false
default connectors_valid := false

valid {
    connectors_valid
}

connectors_valid {
    some vc1 in input.configuration.root_module.resources
    vc1.type == "aws_chime_voice_connector"
    vc1.expressions.require_encryption.constant_value == true

    some vc2 in input.configuration.root_module.resources
    vc2.type == "aws_chime_voice_connector"
    vc2.expressions.require_encryption.constant_value == true

    not vc1 == vc2
    
    some vcgroup in input.configuration.root_module.resources
    vcgroup.type == "aws_chime_voice_connector_group"

    some connector1 in vcgroup.expressions.connector
    vc1.address in connector1.voice_connector_id.references
    some connector2 in vcgroup.expressions.connector
    vc2.address in connector2.voice_connector_id.references
    
    not connector1 == connector2
    
    connector1.priority.constant_value > connector2.priority.constant_value    
}

connectors_valid {
        some vc1 in input.configuration.root_module.resources
    vc1.type == "aws_chime_voice_connector"
    vc1.expressions.require_encryption.constant_value == true

    some vc2 in input.configuration.root_module.resources
    vc2.type == "aws_chime_voice_connector"
    vc2.expressions.require_encryption.constant_value == true

    not vc1 == vc2
    
    some vcgroup in input.configuration.root_module.resources
    vcgroup.type == "aws_chime_voice_connector_group"

    some connector1 in vcgroup.expressions.connector
    vc1.address in connector1.voice_connector_id.references
    some connector2 in vcgroup.expressions.connector
    vc2.address in connector2.voice_connector_id.references
    
    not connector1 == connector2
    
    connector1.priority.constant_value < connector2.priority.constant_value    
}