Skip to content
v2.274.0

Experimental

@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

MatchmakingRuleSet L2 construct ​

Creates a new rule set for FlexMatch matchmaking.

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.

Rule sets must be defined in the same Region as the matchmaking configuration they are used with.

Example ​

ts
new gamelift.MatchmakingRuleSet(this, 'RuleSet', {
  matchmakingRuleSetName: 'my-test-ruleset',
  content: gamelift.RuleSetContent.fromJsonFile(path.join(__dirname, 'my-ruleset', 'ruleset.json')),
});
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
MatchmakingRuleSet.Builder.create(this, "RuleSet")
        .matchmakingRuleSetName("my-test-ruleset")
        .content(RuleSetContent.fromJsonFile(join(__dirname, "my-ruleset", "ruleset.json")))
        .build();
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"))
});
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 ​

ts
new MatchmakingRuleSet(scope: Construct, id: string, props: MatchmakingRuleSetProps)
python
MatchmakingRuleSet(scope: Construct, id: str, props: MatchmakingRuleSetProps)
java
new MatchmakingRuleSet(Construct scope, String id, MatchmakingRuleSetProps props)
csharp
new MatchmakingRuleSet(Construct scope, string id, MatchmakingRuleSetProps props)
go
NewMatchmakingRuleSet(Scope Construct, Id *string, Props MatchmakingRuleSetProps)

Construct Props ​

A collection of matchmaking rules.
matchmakingRuleSetNamestringmatchmaking_rule_set_namestrmatchmakingRuleSetNameStringMatchmakingRuleSetNamestringMatchmakingRuleSetName*stringrequired#
A unique identifier for the matchmaking rule set.

A matchmaking configuration identifies the rule set it uses by this name value.

Note: the rule set name is different from the optional name field in the rule set body

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

matchmakingRuleSetArnstringmatchmaking_rule_set_arnstrmatchmakingRuleSetArnStringMatchmakingRuleSetArnstringMatchmakingRuleSetArn*stringrequired#
The ARN of the ruleSet.
matchmakingRuleSetNamestringmatchmaking_rule_set_namestrmatchmakingRuleSetNameStringMatchmakingRuleSetNamestringMatchmakingRuleSetName*stringrequired#
The unique name of the ruleSet.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

fromMatchmakingRuleSetArn(scope: Construct, id: string, matchmakingRuleSetArn: string): IMatchmakingRuleSet@staticmethod def from_matchmaking_rule_set_arn(scope: Construct, id: str, matchmaking_rule_set_arn: str) -> IMatchmakingRuleSetpublic static IMatchmakingRuleSet fromMatchmakingRuleSetArn(Construct scope, String id, String matchmakingRuleSetArn)public static IMatchmakingRuleSet FromMatchmakingRuleSetArn(Construct scope, string id, string matchmakingRuleSetArn)func FromMatchmakingRuleSetArn(Scope Construct, Id *string, MatchmakingRuleSetArn *string) IMatchmakingRuleSetstatic#
Import a ruleSet into CDK using its ARN.
fromMatchmakingRuleSetAttributes(scope: Construct, id: string, attrs: MatchmakingRuleSetAttributes): IMatchmakingRuleSet@staticmethod def from_matchmaking_rule_set_attributes(scope: Construct, id: str, attrs: MatchmakingRuleSetAttributes) -> IMatchmakingRuleSetpublic static IMatchmakingRuleSet fromMatchmakingRuleSetAttributes(Construct scope, String id, MatchmakingRuleSetAttributes attrs)public static IMatchmakingRuleSet FromMatchmakingRuleSetAttributes(Construct scope, string id, MatchmakingRuleSetAttributes attrs)func FromMatchmakingRuleSetAttributes(Scope Construct, Id *string, Attrs MatchmakingRuleSetAttributes) IMatchmakingRuleSetstatic#
Import an existing matchmaking ruleSet from its attributes.
fromMatchmakingRuleSetName(scope: Construct, id: string, matchmakingRuleSetName: string): IMatchmakingRuleSet@staticmethod def from_matchmaking_rule_set_name(scope: Construct, id: str, matchmaking_rule_set_name: str) -> IMatchmakingRuleSetpublic static IMatchmakingRuleSet fromMatchmakingRuleSetName(Construct scope, String id, String matchmakingRuleSetName)public static IMatchmakingRuleSet FromMatchmakingRuleSetName(Construct scope, string id, string matchmakingRuleSetName)func FromMatchmakingRuleSetName(Scope Construct, Id *string, MatchmakingRuleSetName *string) IMatchmakingRuleSetstatic#
Import a ruleSet into CDK using its name.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this matchmaking ruleSet.
metricRuleEvaluationsFailed(props?: MetricOptions): Metricdef metric_rule_evaluations_failed(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricRuleEvaluationsFailed(MetricOptions props)public Metric MetricRuleEvaluationsFailed(MetricOptions? props = null)func MetricRuleEvaluationsFailed(Props MetricOptions) Metric#
Rule evaluations during matchmaking that failed since the last report.

This metric is limited to the top 50 rules.

metricRuleEvaluationsPassed(props?: MetricOptions): Metricdef metric_rule_evaluations_passed(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricRuleEvaluationsPassed(MetricOptions props)public Metric MetricRuleEvaluationsPassed(MetricOptions? props = null)func MetricRuleEvaluationsPassed(Props MetricOptions) Metric#
Rule evaluations during the matchmaking process that passed since the last report.

This metric is limited to the top 50 rules.

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.