# RuleBasedMatchingProperty

The process of matching duplicate profiles using Rule-Based matching.

If `RuleBasedMatching = true` , Connect Customer Customer Profiles will start to match and merge your profiles according to your configuration in the `RuleBasedMatchingRequest` . You can use the `ListRuleBasedMatches` and `GetSimilarProfiles` API to return and review the results. Also, if you have configured `ExportingConfig` in the `RuleBasedMatchingRequest` , you can download the results from S3.

- Source: Generated at build time
- Type last changed: v2.103.0 · 26 Oct 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_customerprofiles as customerprofiles } from 'aws-cdk-lib';
const ruleBasedMatchingProperty: customerprofiles.CfnDomain.RuleBasedMatchingProperty = {
  enabled: false,

  // the properties below are optional
  attributeTypesSelector: {
    attributeMatchingModel: 'attributeMatchingModel',

    // the properties below are optional
    address: ['address'],
    emailAddress: ['emailAddress'],
    phoneNumber: ['phoneNumber'],
  },
  conflictResolution: {
    conflictResolvingModel: 'conflictResolvingModel',

    // the properties below are optional
    sourceName: 'sourceName',
  },
  exportingConfig: {
    s3Exporting: {
      s3BucketName: 's3BucketName',

      // the properties below are optional
      s3KeyName: 's3KeyName',
    },
  },
  matchingRules: [{
    rule: ['rule'],
  }],
  maxAllowedRuleLevelForMatching: 123,
  maxAllowedRuleLevelForMerging: 123,
  status: 'status',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_customerprofiles as customerprofiles

rule_based_matching_property = customerprofiles.CfnDomain.RuleBasedMatchingProperty(
    enabled=False,

    # the properties below are optional
    attribute_types_selector=customerprofiles.CfnDomain.AttributeTypesSelectorProperty(
        attribute_matching_model="attributeMatchingModel",

        # the properties below are optional
        address=["address"],
        email_address=["emailAddress"],
        phone_number=["phoneNumber"]
    ),
    conflict_resolution=customerprofiles.CfnDomain.ConflictResolutionProperty(
        conflict_resolving_model="conflictResolvingModel",

        # the properties below are optional
        source_name="sourceName"
    ),
    exporting_config=customerprofiles.CfnDomain.ExportingConfigProperty(
        s3_exporting=customerprofiles.CfnDomain.S3ExportingConfigProperty(
            s3_bucket_name="s3BucketName",

            # the properties below are optional
            s3_key_name="s3KeyName"
        )
    ),
    matching_rules=[customerprofiles.CfnDomain.MatchingRuleProperty(
        rule=["rule"]
    )],
    max_allowed_rule_level_for_matching=123,
    max_allowed_rule_level_for_merging=123,
    status="status"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.customerprofiles.*;

RuleBasedMatchingProperty ruleBasedMatchingProperty = RuleBasedMatchingProperty.builder()
        .enabled(false)

        // the properties below are optional
        .attributeTypesSelector(AttributeTypesSelectorProperty.builder()
                .attributeMatchingModel("attributeMatchingModel")

                // the properties below are optional
                .address(List.of("address"))
                .emailAddress(List.of("emailAddress"))
                .phoneNumber(List.of("phoneNumber"))
                .build())
        .conflictResolution(ConflictResolutionProperty.builder()
                .conflictResolvingModel("conflictResolvingModel")

                // the properties below are optional
                .sourceName("sourceName")
                .build())
        .exportingConfig(ExportingConfigProperty.builder()
                .s3Exporting(S3ExportingConfigProperty.builder()
                        .s3BucketName("s3BucketName")

                        // the properties below are optional
                        .s3KeyName("s3KeyName")
                        .build())
                .build())
        .matchingRules(List.of(MatchingRuleProperty.builder()
                .rule(List.of("rule"))
                .build()))
        .maxAllowedRuleLevelForMatching(123)
        .maxAllowedRuleLevelForMerging(123)
        .status("status")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CustomerProfiles;

var ruleBasedMatchingProperty = new RuleBasedMatchingProperty {
    Enabled = false,

    // the properties below are optional
    AttributeTypesSelector = new AttributeTypesSelectorProperty {
        AttributeMatchingModel = "attributeMatchingModel",

        // the properties below are optional
        Address = new [] { "address" },
        EmailAddress = new [] { "emailAddress" },
        PhoneNumber = new [] { "phoneNumber" }
    },
    ConflictResolution = new ConflictResolutionProperty {
        ConflictResolvingModel = "conflictResolvingModel",

        // the properties below are optional
        SourceName = "sourceName"
    },
    ExportingConfig = new ExportingConfigProperty {
        S3Exporting = new S3ExportingConfigProperty {
            S3BucketName = "s3BucketName",

            // the properties below are optional
            S3KeyName = "s3KeyName"
        }
    },
    MatchingRules = new [] { new MatchingRuleProperty {
        Rule = new [] { "rule" }
    } },
    MaxAllowedRuleLevelForMatching = 123,
    MaxAllowedRuleLevelForMerging = 123,
    Status = "status"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

ruleBasedMatchingProperty := &RuleBasedMatchingProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	AttributeTypesSelector: &AttributeTypesSelectorProperty{
		AttributeMatchingModel: jsii.String("attributeMatchingModel"),

		// the properties below are optional
		Address: []*string{
			jsii.String("address"),
		},
		EmailAddress: []*string{
			jsii.String("emailAddress"),
		},
		PhoneNumber: []*string{
			jsii.String("phoneNumber"),
		},
	},
	ConflictResolution: &ConflictResolutionProperty{
		ConflictResolvingModel: jsii.String("conflictResolvingModel"),

		// the properties below are optional
		SourceName: jsii.String("sourceName"),
	},
	ExportingConfig: &ExportingConfigProperty{
		S3Exporting: &S3ExportingConfigProperty{
			S3BucketName: jsii.String("s3BucketName"),

			// the properties below are optional
			S3KeyName: jsii.String("s3KeyName"),
		},
	},
	MatchingRules: []interface{}{
		&MatchingRuleProperty{
			Rule: []*string{
				jsii.String("rule"),
			},
		},
	},
	MaxAllowedRuleLevelForMatching: jsii.Number(123),
	MaxAllowedRuleLevelForMerging: jsii.Number(123),
	Status: jsii.String("status"),
}
```

## Properties

- `attributeTypesSelector`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDomain.AttributeTypesSelectorProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_customerprofiles.CfnDomain.AttributeTypesSelectorProperty.html) — Configures information about the `AttributeTypesSelector` where the rule-based identity resolution uses to match profiles.

- `conflictResolution`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDomain.ConflictResolutionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_customerprofiles.CfnDomain.ConflictResolutionProperty.html) — Determines how the auto-merging process should resolve conflicts between different profiles.

  For example, if Profile A and Profile B have the same `FirstName` and `LastName` , `ConflictResolution` specifies which `EmailAddress` should be used.

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) (required) — The flag that enables the matching process of duplicate profiles.

- `exportingConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDomain.ExportingConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_customerprofiles.CfnDomain.ExportingConfigProperty.html) — The S3 location where Identity Resolution Jobs write result files.

- `matchingRules`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDomain.MatchingRuleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_customerprofiles.CfnDomain.MatchingRuleProperty.html)[] — Configures how the rule-based matching process should match profiles.

  You can have up to 15 `MatchingRule` in the `MatchingRules` .

- `maxAllowedRuleLevelForMatching`: number — Indicates the maximum allowed rule level for matching.

- `maxAllowedRuleLevelForMerging`: number — Indicates the maximum allowed rule level for merging.

- `status`: string — The status of rule-based matching rule.
