@aws-cdk/aws-gamelift-alpha 2.53.0-alpha.0 → 2.55.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/.warnings.jsii.js CHANGED
@@ -1,3 +1,25 @@
1
+ function _aws_cdk_aws_gamelift_alpha_IAlias(p) {
2
+ }
3
+ function _aws_cdk_aws_gamelift_alpha_AliasOptions(p) {
4
+ }
5
+ function _aws_cdk_aws_gamelift_alpha_AliasAttributes(p) {
6
+ }
7
+ function _aws_cdk_aws_gamelift_alpha_AliasProps(p) {
8
+ if (p == null)
9
+ return;
10
+ visitedObjects.add(p);
11
+ try {
12
+ if (!visitedObjects.has(p.fleet))
13
+ _aws_cdk_aws_gamelift_alpha_IFleet(p.fleet);
14
+ }
15
+ finally {
16
+ visitedObjects.delete(p);
17
+ }
18
+ }
19
+ function _aws_cdk_aws_gamelift_alpha_AliasBase(p) {
20
+ }
21
+ function _aws_cdk_aws_gamelift_alpha_Alias(p) {
22
+ }
1
23
  function _aws_cdk_aws_gamelift_alpha_Content(p) {
2
24
  }
3
25
  function _aws_cdk_aws_gamelift_alpha_ContentConfig(p) {
@@ -204,6 +226,94 @@ function _aws_cdk_aws_gamelift_alpha_BuildFleetProps(p) {
204
226
  }
205
227
  function _aws_cdk_aws_gamelift_alpha_BuildFleet(p) {
206
228
  }
229
+ function _aws_cdk_aws_gamelift_alpha_IGameSessionQueueDestination(p) {
230
+ }
231
+ function _aws_cdk_aws_gamelift_alpha_PriorityType(p) {
232
+ }
233
+ function _aws_cdk_aws_gamelift_alpha_PriorityConfiguration(p) {
234
+ if (p == null)
235
+ return;
236
+ visitedObjects.add(p);
237
+ try {
238
+ if (p.priorityOrder != null)
239
+ for (const o of p.priorityOrder)
240
+ if (!visitedObjects.has(o))
241
+ _aws_cdk_aws_gamelift_alpha_PriorityType(o);
242
+ }
243
+ finally {
244
+ visitedObjects.delete(p);
245
+ }
246
+ }
247
+ function _aws_cdk_aws_gamelift_alpha_PlayerLatencyPolicy(p) {
248
+ }
249
+ function _aws_cdk_aws_gamelift_alpha_IGameSessionQueue(p) {
250
+ }
251
+ function _aws_cdk_aws_gamelift_alpha_GameSessionQueueAttributes(p) {
252
+ }
253
+ function _aws_cdk_aws_gamelift_alpha_GameSessionQueueProps(p) {
254
+ if (p == null)
255
+ return;
256
+ visitedObjects.add(p);
257
+ try {
258
+ if (p.destinations != null)
259
+ for (const o of p.destinations)
260
+ if (!visitedObjects.has(o))
261
+ _aws_cdk_aws_gamelift_alpha_IGameSessionQueueDestination(o);
262
+ if (p.playerLatencyPolicies != null)
263
+ for (const o of p.playerLatencyPolicies)
264
+ if (!visitedObjects.has(o))
265
+ _aws_cdk_aws_gamelift_alpha_PlayerLatencyPolicy(o);
266
+ if (!visitedObjects.has(p.priorityConfiguration))
267
+ _aws_cdk_aws_gamelift_alpha_PriorityConfiguration(p.priorityConfiguration);
268
+ }
269
+ finally {
270
+ visitedObjects.delete(p);
271
+ }
272
+ }
273
+ function _aws_cdk_aws_gamelift_alpha_GameSessionQueueBase(p) {
274
+ }
275
+ function _aws_cdk_aws_gamelift_alpha_GameSessionQueue(p) {
276
+ }
277
+ function _aws_cdk_aws_gamelift_alpha_IMatchmakingRuleSet(p) {
278
+ }
279
+ function _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetProps(p) {
280
+ if (p == null)
281
+ return;
282
+ visitedObjects.add(p);
283
+ try {
284
+ if (!visitedObjects.has(p.content))
285
+ _aws_cdk_aws_gamelift_alpha_RuleSetContent(p.content);
286
+ }
287
+ finally {
288
+ visitedObjects.delete(p);
289
+ }
290
+ }
291
+ function _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetAttributes(p) {
292
+ }
293
+ function _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetBase(p) {
294
+ }
295
+ function _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSet(p) {
296
+ }
297
+ function _aws_cdk_aws_gamelift_alpha_IRuleSetBody(p) {
298
+ }
299
+ function _aws_cdk_aws_gamelift_alpha_RuleSetBodyConfig(p) {
300
+ }
301
+ function _aws_cdk_aws_gamelift_alpha_IRuleSetContent(p) {
302
+ }
303
+ function _aws_cdk_aws_gamelift_alpha_RuleSetContentProps(p) {
304
+ if (p == null)
305
+ return;
306
+ visitedObjects.add(p);
307
+ try {
308
+ if (!visitedObjects.has(p.content))
309
+ _aws_cdk_aws_gamelift_alpha_IRuleSetBody(p.content);
310
+ }
311
+ finally {
312
+ visitedObjects.delete(p);
313
+ }
314
+ }
315
+ function _aws_cdk_aws_gamelift_alpha_RuleSetContent(p) {
316
+ }
207
317
  function print(name, deprecationMessage) {
208
318
  const deprecated = process.env.JSII_DEPRECATED;
209
319
  const deprecationMode = ["warn", "fail", "quiet"].includes(deprecated) ? deprecated : "warn";
@@ -240,4 +350,4 @@ class DeprecationError extends Error {
240
350
  });
241
351
  }
242
352
  }
243
- module.exports = { print, getPropertyDescriptor, DeprecationError, _aws_cdk_aws_gamelift_alpha_Content, _aws_cdk_aws_gamelift_alpha_ContentConfig, _aws_cdk_aws_gamelift_alpha_S3Content, _aws_cdk_aws_gamelift_alpha_AssetContent, _aws_cdk_aws_gamelift_alpha_IBuild, _aws_cdk_aws_gamelift_alpha_BuildBase, _aws_cdk_aws_gamelift_alpha_OperatingSystem, _aws_cdk_aws_gamelift_alpha_BuildAttributes, _aws_cdk_aws_gamelift_alpha_BuildProps, _aws_cdk_aws_gamelift_alpha_Build, _aws_cdk_aws_gamelift_alpha_IScript, _aws_cdk_aws_gamelift_alpha_ScriptBase, _aws_cdk_aws_gamelift_alpha_ScriptAttributes, _aws_cdk_aws_gamelift_alpha_ScriptProps, _aws_cdk_aws_gamelift_alpha_Script, _aws_cdk_aws_gamelift_alpha_AutoScalingPolicy, _aws_cdk_aws_gamelift_alpha_InstanceDefinition, _aws_cdk_aws_gamelift_alpha_DeleteOption, _aws_cdk_aws_gamelift_alpha_BalancingStrategy, _aws_cdk_aws_gamelift_alpha_IGameServerGroup, _aws_cdk_aws_gamelift_alpha_GameServerGroupBase, _aws_cdk_aws_gamelift_alpha_GameServerGroupAttributes, _aws_cdk_aws_gamelift_alpha_GameServerGroupProps, _aws_cdk_aws_gamelift_alpha_GameServerGroup, _aws_cdk_aws_gamelift_alpha_Protocol, _aws_cdk_aws_gamelift_alpha_PortProps, _aws_cdk_aws_gamelift_alpha_Port, _aws_cdk_aws_gamelift_alpha_IPeer, _aws_cdk_aws_gamelift_alpha_Peer, _aws_cdk_aws_gamelift_alpha_IngressRule, _aws_cdk_aws_gamelift_alpha_LocationCapacity, _aws_cdk_aws_gamelift_alpha_Location, _aws_cdk_aws_gamelift_alpha_ServerProcess, _aws_cdk_aws_gamelift_alpha_RuntimeConfiguration, _aws_cdk_aws_gamelift_alpha_ResourceCreationLimitPolicy, _aws_cdk_aws_gamelift_alpha_IFleet, _aws_cdk_aws_gamelift_alpha_FleetProps, _aws_cdk_aws_gamelift_alpha_FleetAttributes, _aws_cdk_aws_gamelift_alpha_FleetBase, _aws_cdk_aws_gamelift_alpha_IBuildFleet, _aws_cdk_aws_gamelift_alpha_BuildFleetProps, _aws_cdk_aws_gamelift_alpha_BuildFleet };
353
+ module.exports = { print, getPropertyDescriptor, DeprecationError, _aws_cdk_aws_gamelift_alpha_IAlias, _aws_cdk_aws_gamelift_alpha_AliasOptions, _aws_cdk_aws_gamelift_alpha_AliasAttributes, _aws_cdk_aws_gamelift_alpha_AliasProps, _aws_cdk_aws_gamelift_alpha_AliasBase, _aws_cdk_aws_gamelift_alpha_Alias, _aws_cdk_aws_gamelift_alpha_Content, _aws_cdk_aws_gamelift_alpha_ContentConfig, _aws_cdk_aws_gamelift_alpha_S3Content, _aws_cdk_aws_gamelift_alpha_AssetContent, _aws_cdk_aws_gamelift_alpha_IBuild, _aws_cdk_aws_gamelift_alpha_BuildBase, _aws_cdk_aws_gamelift_alpha_OperatingSystem, _aws_cdk_aws_gamelift_alpha_BuildAttributes, _aws_cdk_aws_gamelift_alpha_BuildProps, _aws_cdk_aws_gamelift_alpha_Build, _aws_cdk_aws_gamelift_alpha_IScript, _aws_cdk_aws_gamelift_alpha_ScriptBase, _aws_cdk_aws_gamelift_alpha_ScriptAttributes, _aws_cdk_aws_gamelift_alpha_ScriptProps, _aws_cdk_aws_gamelift_alpha_Script, _aws_cdk_aws_gamelift_alpha_AutoScalingPolicy, _aws_cdk_aws_gamelift_alpha_InstanceDefinition, _aws_cdk_aws_gamelift_alpha_DeleteOption, _aws_cdk_aws_gamelift_alpha_BalancingStrategy, _aws_cdk_aws_gamelift_alpha_IGameServerGroup, _aws_cdk_aws_gamelift_alpha_GameServerGroupBase, _aws_cdk_aws_gamelift_alpha_GameServerGroupAttributes, _aws_cdk_aws_gamelift_alpha_GameServerGroupProps, _aws_cdk_aws_gamelift_alpha_GameServerGroup, _aws_cdk_aws_gamelift_alpha_Protocol, _aws_cdk_aws_gamelift_alpha_PortProps, _aws_cdk_aws_gamelift_alpha_Port, _aws_cdk_aws_gamelift_alpha_IPeer, _aws_cdk_aws_gamelift_alpha_Peer, _aws_cdk_aws_gamelift_alpha_IngressRule, _aws_cdk_aws_gamelift_alpha_LocationCapacity, _aws_cdk_aws_gamelift_alpha_Location, _aws_cdk_aws_gamelift_alpha_ServerProcess, _aws_cdk_aws_gamelift_alpha_RuntimeConfiguration, _aws_cdk_aws_gamelift_alpha_ResourceCreationLimitPolicy, _aws_cdk_aws_gamelift_alpha_IFleet, _aws_cdk_aws_gamelift_alpha_FleetProps, _aws_cdk_aws_gamelift_alpha_FleetAttributes, _aws_cdk_aws_gamelift_alpha_FleetBase, _aws_cdk_aws_gamelift_alpha_IBuildFleet, _aws_cdk_aws_gamelift_alpha_BuildFleetProps, _aws_cdk_aws_gamelift_alpha_BuildFleet, _aws_cdk_aws_gamelift_alpha_IGameSessionQueueDestination, _aws_cdk_aws_gamelift_alpha_PriorityType, _aws_cdk_aws_gamelift_alpha_PriorityConfiguration, _aws_cdk_aws_gamelift_alpha_PlayerLatencyPolicy, _aws_cdk_aws_gamelift_alpha_IGameSessionQueue, _aws_cdk_aws_gamelift_alpha_GameSessionQueueAttributes, _aws_cdk_aws_gamelift_alpha_GameSessionQueueProps, _aws_cdk_aws_gamelift_alpha_GameSessionQueueBase, _aws_cdk_aws_gamelift_alpha_GameSessionQueue, _aws_cdk_aws_gamelift_alpha_IMatchmakingRuleSet, _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetProps, _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetAttributes, _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSetBase, _aws_cdk_aws_gamelift_alpha_MatchmakingRuleSet, _aws_cdk_aws_gamelift_alpha_IRuleSetBody, _aws_cdk_aws_gamelift_alpha_RuleSetBodyConfig, _aws_cdk_aws_gamelift_alpha_IRuleSetContent, _aws_cdk_aws_gamelift_alpha_RuleSetContentProps, _aws_cdk_aws_gamelift_alpha_RuleSetContent };
package/README.md CHANGED
@@ -44,6 +44,73 @@ deliver inexpensive, resilient game hosting for your players
44
44
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. It allows you to define components for your matchmaking
45
45
  configuration or game server fleet management system.
46
46
 
47
+ ## GameLift FlexMatch
48
+
49
+ ### Matchmaking RuleSet
50
+
51
+ Every FlexMatch matchmaker must have a rule set. The rule set determines the
52
+ two key elements of a match: your game's team structure and size, and how to
53
+ group players together for the best possible match.
54
+
55
+ For example, a rule set might describe a match like this: Create a match with
56
+ two teams of four to eight players each, one team is the cowboy and the other
57
+ team the aliens. A team can have novice and experienced players, but the
58
+ average skill of the two teams must be within 10 points of each other. If no
59
+ match is made after 30 seconds, gradually relax the skill requirements.
60
+
61
+ ```ts
62
+ new gamelift.MatchmakingRuleSet(this, 'RuleSet', {
63
+ matchmakingRuleSetName: 'my-test-ruleset',
64
+ content: gamelift.RuleSetContent.fromJsonFile(path.join(__dirname, 'my-ruleset/ruleset.json')),
65
+ });
66
+ ```
67
+
68
+ ### FlexMatch Monitoring
69
+
70
+ You can monitor GameLift FlexMatch activity for matchmaking configurations and
71
+ matchmaking rules using Amazon CloudWatch. These statistics are used to provide
72
+ a historical perspective on how your Gamelift FlexMatch solution is performing.
73
+
74
+ #### FlexMatch Metrics
75
+
76
+ GameLift FlexMatch sends metrics to CloudWatch so that you can collect and
77
+ analyze the activity of your matchmaking solution, including match acceptance
78
+ workflow, ticket consumtion.
79
+
80
+ You can then use CloudWatch alarms to alert you, for example, when matches has
81
+ been rejected (potential matches that were rejected by at least one player
82
+ since the last report) exceed a certain thresold which could means that you may
83
+ have an issue in your matchmaking rules.
84
+
85
+ CDK provides methods for accessing GameLift FlexMatch metrics with default configuration,
86
+ such as `metricRuleEvaluationsPassed`, or `metricRuleEvaluationsFailed` (see
87
+ [`IMatchmakingRuleSet`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-gamelift.IMatchmakingRuleSet.html)
88
+ for a full list). CDK also provides a generic `metric` method that can be used
89
+ to produce metric configurations for any metric provided by GameLift FlexMatch;
90
+ the configurations are pre-populated with the correct dimensions for the
91
+ matchmaking configuration.
92
+
93
+ ```ts
94
+ declare const matchmakingRuleSet: gamelift.MatchmakingRuleSet;
95
+ // Alarm that triggers when the per-second average of not placed matches exceed 10%
96
+ const ruleEvaluationRatio = new cloudwatch.MathExpression({
97
+ expression: '1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)',
98
+ usingMetrics: {
99
+ ruleEvaluationsPassed: matchmakingRuleSet.metricRuleEvaluationsPassed({ statistic: cloudwatch.Statistic.SUM }),
100
+ ruleEvaluationsFailed: matchmakingRuleSet.metric('ruleEvaluationsFailed'),
101
+ },
102
+ });
103
+ new cloudwatch.Alarm(this, 'Alarm', {
104
+ metric: ruleEvaluationRatio,
105
+ threshold: 0.1,
106
+ evaluationPeriods: 3,
107
+ });
108
+ ```
109
+
110
+ See: [Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html)
111
+ in the *Amazon GameLift Developer Guide*.
112
+
113
+
47
114
  ## GameLift Hosting
48
115
 
49
116
  ### Uploading builds and scripts to GameLift
@@ -74,9 +141,12 @@ services.
74
141
 
75
142
  ```ts
76
143
  declare const bucket: s3.Bucket;
77
- new gamelift.Build(this, 'Build', {
144
+ const build = new gamelift.Build(this, 'Build', {
78
145
  content: gamelift.Content.fromBucket(bucket, "sample-asset-key")
79
146
  });
147
+
148
+ new CfnOutput(this, 'BuildArn', { value: build.buildArn });
149
+ new CfnOutput(this, 'BuildId', { value: build.buildId });
80
150
  ```
81
151
 
82
152
  #### Upload a realtime server Script
@@ -280,7 +350,7 @@ fleet.addLocation('ap-southeast-1', 5, 2, 10);
280
350
  Some GameLift features require you to extend limited access to your AWS
281
351
  resources. This is done by creating an AWS IAM role. The GameLift Fleet class
282
352
  automatically created an IAM role with all the minimum necessary permissions
283
- for GameLift to access your ressources. If you wish, you may
353
+ for GameLift to access your resources. If you wish, you may
284
354
  specify your own IAM role.
285
355
 
286
356
  ```ts
@@ -306,12 +376,36 @@ const fleet = new gamelift.BuildFleet(this, 'Game server fleet', {
306
376
  fleet.grant(role, 'gamelift:ListFleets');
307
377
  ```
308
378
 
379
+ ### Alias
380
+
381
+ A GameLift alias is used to abstract a fleet designation. Fleet designations
382
+ tell Amazon GameLift where to search for available resources when creating new
383
+ game sessions for players. By using aliases instead of specific fleet IDs, you
384
+ can more easily and seamlessly switch player traffic from one fleet to another
385
+ by changing the alias's target location.
386
+
387
+ ```ts
388
+ declare const fleet: gamelift.BuildFleet;
389
+
390
+ // Add an alias to an existing fleet using a dedicated fleet method
391
+ const liveAlias = fleet.addAlias('live');
392
+
393
+ // You can also create a standalone alias
394
+ new gamelift.Alias(this, 'TerminalAlias', {
395
+ aliasName: 'terminal-alias',
396
+ terminalMessage: 'A terminal message',
397
+ });
398
+ ```
399
+
400
+ See [Add an alias to a GameLift fleet](https://docs.aws.amazon.com/gamelift/latest/developerguide/aliases-creating.html)
401
+ in the *Amazon GameLift Developer Guide*.
402
+
309
403
  ### Monitoring your Fleet
310
404
 
311
405
  GameLift is integrated with CloudWatch, so you can monitor the performance of
312
406
  your game servers via logs and metrics.
313
407
 
314
- #### Metrics
408
+ #### Fleet Metrics
315
409
 
316
410
  GameLift Fleet sends metrics to CloudWatch so that you can collect and analyze
317
411
  the activity of your Fleet, including game and player sessions and server
@@ -319,7 +413,7 @@ processes.
319
413
 
320
414
  You can then use CloudWatch alarms to alert you, for example, when matches has
321
415
  been rejected (potential matches that were rejected by at least one player
322
- since the last report) exceed a certain thresold which could means that you may
416
+ since the last report) exceed a certain threshold which could means that you may
323
417
  have an issue in your matchmaking rules.
324
418
 
325
419
  CDK provides methods for accessing GameLift Fleet metrics with default configuration,
@@ -349,6 +443,65 @@ new cloudwatch.Alarm(this, 'Alarm', {
349
443
  See: [Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html)
350
444
  in the *Amazon GameLift Developer Guide*.
351
445
 
446
+ ## Game session queue
447
+
448
+ The game session queue is the primary mechanism for processing new game session
449
+ requests and locating available game servers to host them. Although it is
450
+ possible to request a new game session be hosted on specific fleet or location.
451
+
452
+ The `GameSessionQueue` resource creates a placement queue that processes requests for
453
+ new game sessions. A queue uses FleetIQ algorithms to determine the best placement
454
+ locations and find an available game server, then prompts the game server to start a
455
+ new game session. Queues can have destinations (GameLift fleets or aliases), which
456
+ determine where the queue can place new game sessions. A queue can have destinations
457
+ with varied fleet type (Spot and On-Demand), instance type, and AWS Region.
458
+
459
+ ```ts
460
+ declare const fleet: gamelift.BuildFleet;
461
+ declare const alias: gamelift.Alias;
462
+
463
+ const queue = new gamelift.GameSessionQueue(this, 'GameSessionQueue', {
464
+ gameSessionQueueName: 'my-queue-name',
465
+ destinations: [fleet]
466
+ });
467
+ queue.addDestination(alias);
468
+ ```
469
+
470
+ A more complex configuration can also be definied to override how FleetIQ algorithms prioritize game session placement in order to favour a destination based on `Cost`, `Latency`, `Destination order`or `Location`.
471
+
472
+ ```ts
473
+ declare const fleet: gamelift.BuildFleet;
474
+ declare const topic: sns.Topic;
475
+
476
+ new gamelift.GameSessionQueue(this, 'MyGameSessionQueue', {
477
+ gameSessionQueueName: 'test-gameSessionQueue',
478
+ customEventData: 'test-event-data',
479
+ allowedLocations: ['eu-west-1', 'eu-west-2'],
480
+ destinations: [fleet],
481
+ notificationTarget: topic,
482
+ playerLatencyPolicies: [{
483
+ maximumIndividualPlayerLatency: Duration.millis(100),
484
+ policyDuration: Duration.seconds(300),
485
+ }],
486
+ priorityConfiguration: {
487
+ locationOrder: [
488
+ 'eu-west-1',
489
+ 'eu-west-2',
490
+ ],
491
+ priorityOrder: [
492
+ gamelift.PriorityType.LATENCY,
493
+ gamelift.PriorityType.COST,
494
+ gamelift.PriorityType.DESTINATION,
495
+ gamelift.PriorityType.LOCATION,
496
+ ],
497
+ },
498
+ timeout: Duration.seconds(300),
499
+ });
500
+ ```
501
+
502
+ See [Setting up GameLift queues for game session placement](https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script-uploading.html)
503
+ in the *Amazon GameLift Developer Guide*.
504
+
352
505
  ## GameLift FleetIQ
353
506
 
354
507
  The GameLift FleetIQ solution is a game hosting layer that supplements the full
@@ -427,7 +580,7 @@ in the *Amazon GameLift FleetIQ Developer Guide*.
427
580
 
428
581
  The GameLift FleetIQ class automatically creates an IAM role with all the minimum necessary
429
582
  permissions for GameLift to access your Amazon EC2 Auto Scaling groups. If you wish, you may
430
- specify your own IAM role. It must have the correct permissions, or FleetIQ creation or ressource usage may fail.
583
+ specify your own IAM role. It must have the correct permissions, or FleetIQ creation or resource usage may fail.
431
584
 
432
585
  ```ts
433
586
  declare const launchTemplate: ec2.ILaunchTemplate;
@@ -484,7 +637,7 @@ new gamelift.GameServerGroup(this, 'GameServerGroup', {
484
637
  });
485
638
  ```
486
639
 
487
- ### Monitoring
640
+ ### FleetIQ Monitoring
488
641
 
489
642
  GameLift FleetIQ sends metrics to CloudWatch so that you can collect and
490
643
  analyze the activity of your Game server fleet, including the number of
@@ -493,7 +646,7 @@ limited Spot availability.
493
646
 
494
647
  You can then use CloudWatch alarms to alert you, for example, when the portion
495
648
  of game servers that are currently supporting game executions exceed a certain
496
- thresold which could means that your autoscaling policy need to be adjust to
649
+ threshold which could means that your autoscaling policy need to be adjust to
497
650
  add more instances to match with player demand.
498
651
 
499
652
  CDK provides a generic `metric` method that can be used
package/lib/alias.d.ts ADDED
@@ -0,0 +1,146 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ import { IFleet } from './fleet-base';
4
+ import { IGameSessionQueueDestination } from './game-session-queue';
5
+ /**
6
+ * Represents a Gamelift Alias for a Gamelift fleet destination.
7
+ */
8
+ export interface IAlias extends cdk.IResource, IGameSessionQueueDestination {
9
+ /**
10
+ * The Identifier of the alias.
11
+ *
12
+ * @attribute
13
+ */
14
+ readonly aliasId: string;
15
+ /**
16
+ * The ARN of the alias.
17
+ *
18
+ * @attribute
19
+ */
20
+ readonly aliasArn: string;
21
+ }
22
+ /**
23
+ * Options for `gamelift.Alias`.
24
+ */
25
+ export interface AliasOptions {
26
+ /**
27
+ * Description for the alias
28
+ *
29
+ * @default No description
30
+ */
31
+ readonly description?: string;
32
+ }
33
+ /**
34
+ * A full specification of an alias that can be used to import it fluently into the CDK application.
35
+ */
36
+ export interface AliasAttributes {
37
+ /**
38
+ * The ARN of the alias
39
+ *
40
+ * At least one of `aliasArn` and `aliasId` must be provided.
41
+ *
42
+ * @default derived from `aliasId`.
43
+ */
44
+ readonly aliasArn?: string;
45
+ /**
46
+ * The identifier of the alias
47
+ *
48
+ * At least one of `aliasId` and `aliasArn` must be provided.
49
+ *
50
+ * @default derived from `aliasArn`.
51
+ */
52
+ readonly aliasId?: string;
53
+ }
54
+ /**
55
+ * Properties for a new Fleet alias
56
+ */
57
+ export interface AliasProps {
58
+ /**
59
+ * Name of this alias
60
+ */
61
+ readonly aliasName: string;
62
+ /**
63
+ * A human-readable description of the alias
64
+ *
65
+ * @default no description
66
+ */
67
+ readonly description?: string;
68
+ /**
69
+ * A fleet that the alias points to.
70
+ * If specified, the alias resolves to one specific fleet.
71
+ *
72
+ * At least one of `fleet` and `terminalMessage` must be provided.
73
+ *
74
+ * @default no fleet that the alias points to.
75
+ */
76
+ readonly fleet?: IFleet;
77
+ /**
78
+ * The message text to be used with a terminal routing strategy.
79
+ *
80
+ * At least one of `fleet` and `terminalMessage` must be provided.
81
+ *
82
+ * @default no terminal message
83
+ */
84
+ readonly terminalMessage?: string;
85
+ }
86
+ /**
87
+ * Base class for new and imported GameLift Alias.
88
+ */
89
+ export declare abstract class AliasBase extends cdk.Resource implements IAlias {
90
+ /**
91
+ * The Identifier of the alias.
92
+ */
93
+ abstract readonly aliasId: string;
94
+ /**
95
+ * The ARN of the alias
96
+ */
97
+ abstract readonly aliasArn: string;
98
+ /**
99
+ * The ARN to put into the destination field of a game session queue
100
+ */
101
+ get resourceArnForDestination(): string;
102
+ }
103
+ /**
104
+ * A Amazon GameLift alias is used to abstract a fleet designation.
105
+ * Fleet designations tell GameLift where to search for available resources when creating new game sessions for players.
106
+ * Use aliases instead of specific fleet IDs to seamlessly switch player traffic from one fleet to another by changing the alias's target location.
107
+ *
108
+ * Aliases are useful in games that don't use queues.
109
+ * Switching fleets in a queue is a simple matter of creating a new fleet, adding it to the queue, and removing the old fleet, none of which is visible to players.
110
+ * In contrast, game clients that don't use queues must specify which fleet to use when communicating with the GameLift service.
111
+ * Without aliases, a fleet switch requires updates to your game code and possibly distribution of an updated game clients to players.
112
+ *
113
+ * When updating the fleet-id an alias points to, there is a transition period of up to 2 minutes where game sessions on the alias may end up on the old fleet.
114
+ *
115
+ * @see https://docs.aws.amazon.com/gamelift/latest/developerguide/aliases-creating.html
116
+ *
117
+ * @resource AWS::GameLift::Alias
118
+ */
119
+ export declare class Alias extends AliasBase {
120
+ /**
121
+ * Import an existing alias from its identifier.
122
+ */
123
+ static fromAliasId(scope: Construct, id: string, aliasId: string): IAlias;
124
+ /**
125
+ * Import an existing alias from its ARN.
126
+ */
127
+ static fromAliasArn(scope: Construct, id: string, aliasArn: string): IAlias;
128
+ /**
129
+ * Import an existing alias from its attributes.
130
+ */
131
+ static fromAliasAttributes(scope: Construct, id: string, attrs: AliasAttributes): IAlias;
132
+ /**
133
+ * The Identifier of the alias.
134
+ */
135
+ readonly aliasId: string;
136
+ /**
137
+ * The ARN of the alias.
138
+ */
139
+ readonly aliasArn: string;
140
+ /**
141
+ * A fleet that the alias points to.
142
+ */
143
+ readonly fleet?: IFleet;
144
+ constructor(scope: Construct, id: string, props: AliasProps);
145
+ private parseRoutingStrategy;
146
+ }