> **Experimental**
>
> `@aws-cdk/aws-gamelift-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# RuleSetContent

The rule set determines the two key elements of a match: your game's team structure and size, and how to group players together for the best possible match.

For example, a rule set might describe a match like this:
- Create a match with two teams of five players each, one team is the defenders and the other team the invaders.
- A team can have novice and experienced players, but the average skill of the two teams must be within 10 points of each other.
- If no match is made after 30 seconds, gradually relax the skill requirements.

Implements: [IRuleSetContent](/cdk/api/v2/docs/@aws-cdk_aws-gamelift-alpha.IRuleSetContent.html)

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/matchmaking-ruleset-body.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-gamelift-alpha/lib/matchmaking-ruleset-body.ts#L59)

## Example

TypeScript:

```ts
new gamelift.MatchmakingRuleSet(this, 'RuleSet', {
  matchmakingRuleSetName: 'my-test-ruleset',
  content: gamelift.RuleSetContent.fromJsonFile(path.join(__dirname, 'my-ruleset', 'ruleset.json')),
});
```

Python:

```python
gamelift.MatchmakingRuleSet(self, "RuleSet",
    matchmaking_rule_set_name="my-test-ruleset",
    content=gamelift.RuleSetContent.from_json_file(path.join(__dirname, "my-ruleset", "ruleset.json"))
)
```

Java:

```java
MatchmakingRuleSet.Builder.create(this, "RuleSet")
        .matchmakingRuleSetName("my-test-ruleset")
        .content(RuleSetContent.fromJsonFile(join(__dirname, "my-ruleset", "ruleset.json")))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
new MatchmakingRuleSet(this, "RuleSet", new MatchmakingRuleSetProps {
    MatchmakingRuleSetName = "my-test-ruleset",
    Content = RuleSetContent.FromJsonFile(Join(__dirname, "my-ruleset", "ruleset.json"))
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
gamelift.NewMatchmakingRuleSet(this, jsii.String("RuleSet"), &MatchmakingRuleSetProps{
	MatchmakingRuleSetName: jsii.String("my-test-ruleset"),
	Content: gamelift.RuleSetContent_FromJsonFile(path.join(__dirname, jsii.String("my-ruleset"), jsii.String("ruleset.json"))),
})
```

## Initializer

TypeScript:

```ts
new RuleSetContent(props: RuleSetContentProps)
```

Python:

```python
RuleSetContent(props: RuleSetContentProps)
```

Java:

```java
new RuleSetContent(RuleSetContentProps props)
```

C# / .NET:

```csharp
new RuleSetContent(RuleSetContentProps props)
```

Golang:

```go
NewRuleSetContent(Props RuleSetContentProps)
```

## Properties

- `content`: [IRuleSetBody](/cdk/api/v2/docs/@aws-cdk_aws-gamelift-alpha.IRuleSetBody.html) — RuleSet body content.

## Methods

- `bind(_scope: Construct): RuleSetBodyConfig` — Called when the matchmaking ruleSet is initialized to allow this object to bind to the stack and add resources.

  **Parameters**

  - `_scope` — The binding scope.

- `fromInline(body: string): IRuleSetContent` (static) — Inline body for Matchmaking ruleSet.

  **Parameters**

  - `body` — The actual ruleSet body (maximum 65535 characters).

  **Returns:** `RuleSetContent` with inline code.

- `fromJsonFile(path: string): IRuleSetContent` (static) — Matchmaking ruleSet body from a file.

  **Parameters**

  - `path` — The path to the ruleSet body file.

  **Returns:** `RuleSetContentBase` based on JSON file content.
