MatchmakingRuleSet
- class aws_cdk.aws_gamelift_alpha.MatchmakingRuleSet(scope, id, *, content, matchmaking_rule_set_name)
Bases:
MatchmakingRuleSetBase
(experimental) 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.
- See:
https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html
- Stability:
experimental
- Resource:
AWS::GameLift::MatchmakingRuleSet
- ExampleMetadata:
infused
Example:
gamelift.MatchmakingRuleSet(self, "RuleSet", matchmaking_rule_set_name="my-test-ruleset", content=gamelift.RuleSetContent.from_json_file(path.join(__dirname, "my-ruleset", "ruleset.json")) )
- Parameters:
scope (
Construct
) –id (
str
) –content (
RuleSetContent
) – (experimental) A collection of matchmaking rules.matchmaking_rule_set_name (
str
) – (experimental) 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
- Stability:
experimental
Methods
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
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
).- Parameters:
policy (
RemovalPolicy
) –- Return type:
None
- metric(metric_name, *, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(experimental) Return the given named metric for this matchmaking ruleSet.
- Parameters:
metric_name (
str
) –account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) – Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No labelperiod (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Stability:
experimental
- Return type:
- metric_rule_evaluations_failed(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(experimental) Rule evaluations during matchmaking that failed since the last report.
This metric is limited to the top 50 rules.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Stability:
experimental
- Return type:
- metric_rule_evaluations_passed(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(experimental) Rule evaluations during the matchmaking process that passed since the last report.
This metric is limited to the top 50 rules.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Stability:
experimental
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- matchmaking_rule_set_arn
(experimental) The ARN of the ruleSet.
- Stability:
experimental
- matchmaking_rule_set_name
(experimental) The unique name of the ruleSet.
- Stability:
experimental
- node
The tree node.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_matchmaking_rule_set_arn(scope, id, matchmaking_rule_set_arn)
(experimental) Import a ruleSet into CDK using its ARN.
- Parameters:
scope (
Construct
) –id (
str
) –matchmaking_rule_set_arn (
str
) –
- Stability:
experimental
- Return type:
- classmethod from_matchmaking_rule_set_attributes(scope, id, *, matchmaking_rule_set_arn=None, matchmaking_rule_set_name=None)
(experimental) Import an existing matchmaking ruleSet from its attributes.
- Parameters:
scope (
Construct
) –id (
str
) –matchmaking_rule_set_arn (
Optional
[str
]) – (experimental) The ARN of the matchmaking ruleSet. At least one ofmatchmakingRuleSetArn
andmatchmakingRuleSetName
must be provided. Default: derived frommatchmakingRuleSetName
.matchmaking_rule_set_name (
Optional
[str
]) – (experimental) The unique name of the matchmaking ruleSet. At least one ofruleSetName
andmatchmakingRuleSetArn
must be provided. Default: derived frommatchmakingRuleSetArn
.
- Stability:
experimental
- Return type:
- classmethod from_matchmaking_rule_set_name(scope, id, matchmaking_rule_set_name)
(experimental) Import a ruleSet into CDK using its name.
- Parameters:
scope (
Construct
) –id (
str
) –matchmaking_rule_set_name (
str
) –
- Stability:
experimental
- Return type:
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
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 classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
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 theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool