<commit_before>package aws

import (
	"fmt"
	"log"
	"strings"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/glue"
	"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
	"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)

func resourceAwsGlueConnection() *schema.Resource {
	return &schema.Resource{
		Create: resourceAwsGlueConnectionCreate,
		Read:   resourceAwsGlueConnectionRead,
		Update: resourceAwsGlueConnectionUpdate,
		Delete: resourceAwsGlueConnectionDelete,
		Importer: &schema.ResourceImporter{
			State: schema.ImportStatePassthrough,
		},

		Schema: map[string]*schema.Schema{
			"catalog_id": {
				Type:     schema.TypeString,
				ForceNew: true,
				Optional: true,
				Computed: true,
			},
			"connection_properties": {
				Type:      schema.TypeMap,
				Required:  true,
				Sensitive: true,
			},
			"connection_type": {
				Type:     schema.TypeString,
				Optional: true,
				Default:  glue.ConnectionTypeJdbc,
				ValidateFunc: validation.StringInSlice([]string{
					glue.ConnectionTypeJdbc,
					glue.ConnectionTypeSftp,
				}, false),
			},
			"description": {
				Type:     schema.TypeString,
				Optional: true,
			},
			"match_criteria": {
				Type:     schema.TypeList,
				Optional: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
			},
			"name": {
				Type:         schema.TypeString,
				Required:     true,
				ForceNew:     true,
				ValidateFunc: validation.NoZeroValues,
			},
			"physical_connection_requirements": {<commit_msg>feat: support mongodb connection type for AWS Glue<commit_after>package aws

import (
	"fmt"
	"log"
	"strings"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/glue"
	"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
	"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)

func resourceAwsGlueConnection() *schema.Resource {
	return &schema.Resource{
		Create: resourceAwsGlueConnectionCreate,
		Read:   resourceAwsGlueConnectionRead,
		Update: resourceAwsGlueConnectionUpdate,
		Delete: resourceAwsGlueConnectionDelete,
		Importer: &schema.ResourceImporter{
			State: schema.ImportStatePassthrough,
		},

		Schema: map[string]*schema.Schema{
			"catalog_id": {
				Type:     schema.TypeString,
				ForceNew: true,
				Optional: true,
				Computed: true,
			},
			"connection_properties": {
				Type:      schema.TypeMap,
				Required:  true,
				Sensitive: true,
			},
			"connection_type": {
				Type:     schema.TypeString,
				Optional: true,
				Default:  glue.ConnectionTypeJdbc,
				ValidateFunc: validation.StringInSlice([]string{
					glue.ConnectionTypeJdbc,
					glue.ConnectionTypeSftp,
					glue.ConnectionTypeMongodb,
				}, false),
			},
			"description": {
				Type:     schema.TypeString,
				Optional: true,
			},
			"match_criteria": {
				Type:     schema.TypeList,
				Optional: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
			},
			"name": {
				Type:         schema.TypeString,
				Required:     true,
				ForceNew:     true,
				ValidateFunc: validation.NoZeroValues,
			},
			"physical_connection_requirements": {
{'fraction_non_alphanumeric': 0.11842105263157894, 'fraction_numerical': 0.0, 'mean_word_length': 3.3716690042075736, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5306284', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1039, 'n_words': 168}