Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gamelift): add GameSessionQueue L2 Construct for GameLift #23266

Merged
merged 7 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding missing files
  • Loading branch information
stevehouel committed Dec 7, 2022
commit 62a13ba5cbf9df6fbdb07f8fa266fbabd2b5d322
576 changes: 576 additions & 0 deletions packages/@aws-cdk/aws-gamelift/test/game-session-queue.test.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "22.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "GameSessionQueueDefaultTestDeployAssert72367A40.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# make sure the gameserver is executable
/usr/bin/chmod +x /local/game/TestApplicationServer
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "22.0.0",
"files": {
"b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37": {
"source": {
"path": "asset.b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"5cb96a6837fa171aa6c3da922798ccc4fbf1c2c083c89fe9882dfad8757930dd": {
"source": {
"path": "aws-gamelift-gameSessionQueue.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "5cb96a6837fa171aa6c3da922798ccc4fbf1c2c083c89fe9882dfad8757930dd.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"Resources": {
"BuildServiceRole1F57E904": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "gamelift.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"BuildServiceRoleDefaultPolicyCB7101C6": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"s3:GetObject",
"s3:GetObjectVersion"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::",
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip"
]
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "BuildServiceRoleDefaultPolicyCB7101C6",
"Roles": [
{
"Ref": "BuildServiceRole1F57E904"
}
]
}
},
"Build45A36621": {
"Type": "AWS::GameLift::Build",
"Properties": {
"OperatingSystem": "AMAZON_LINUX_2",
"StorageLocation": {
"Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"Key": "b95e4173bc399a8f686a4951aa26e01de1ed1e9d981ee1a7f18a15512dbdcb37.zip",
"RoleArn": {
"Fn::GetAtt": [
"BuildServiceRole1F57E904",
"Arn"
]
}
}
},
"DependsOn": [
"BuildServiceRoleDefaultPolicyCB7101C6",
"BuildServiceRole1F57E904"
]
},
"BuildFleetServiceRole32D49FB4": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"ec2.amazonaws.com",
"gamelift.amazonaws.com"
]
}
}
],
"Version": "2012-10-17"
}
}
},
"BuildFleet027ED403": {
"Type": "AWS::GameLift::Fleet",
"Properties": {
"BuildId": {
"Ref": "Build45A36621"
},
"CertificateConfiguration": {
"CertificateType": "DISABLED"
},
"EC2InboundPermissions": [
{
"FromPort": 1935,
"IpRange": "0.0.0.0/0",
"Protocol": "TCP",
"ToPort": 1935
}
],
"EC2InstanceType": "c5.large",
"FleetType": "ON_DEMAND",
"InstanceRoleARN": {
"Fn::GetAtt": [
"BuildFleetServiceRole32D49FB4",
"Arn"
]
},
"MaxSize": 1,
"MinSize": 0,
"Name": "test-fleet",
"NewGameSessionProtectionPolicy": "NoProtection",
"RuntimeConfiguration": {
"GameSessionActivationTimeoutSeconds": 300,
"MaxConcurrentGameSessionActivations": 1,
"ServerProcesses": [
{
"ConcurrentExecutions": 1,
"LaunchPath": "/local/game/TestApplicationServer",
"Parameters": "port:1935 gameSessionLengthSeconds:20"
}
]
}
}
},
"BuildFleetAliaslive3FE0BB2F": {
"Type": "AWS::GameLift::Alias",
"Properties": {
"Name": "live",
"RoutingStrategy": {
"FleetId": {
"Ref": "BuildFleet027ED403"
},
"Type": "SIMPLE"
}
}
},
"MyTopic86869434": {
"Type": "AWS::SNS::Topic"
},
"MyGameSessionQueue1A15CE31": {
"Type": "AWS::GameLift::GameSessionQueue",
"Properties": {
"Name": "test-gameSessionQueue",
"CustomEventData": "test-event-data",
"Destinations": [
{
"DestinationArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":gamelift:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":fleet/",
{
"Ref": "BuildFleet027ED403"
}
]
]
}
},
{
"DestinationArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":gamelift:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":alias/",
{
"Ref": "BuildFleetAliaslive3FE0BB2F"
}
]
]
}
}
],
"FilterConfiguration": {
"AllowedLocations": [
"eu-west-1",
"eu-west-2"
]
},
"NotificationTarget": {
"Ref": "MyTopic86869434"
},
"PlayerLatencyPolicies": [
{
"MaximumIndividualPlayerLatencyMilliseconds": 100,
"PolicyDurationSeconds": 300
}
],
"PriorityConfiguration": {
"LocationOrder": [
"eu-west-1",
"eu-west-2"
],
"PriorityOrder": [
"LATENCY",
"COST",
"DESTINATION",
"LOCATION"
]
},
"TimeoutInSeconds": 300
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"22.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "22.0.0",
"testCases": {
"GameSessionQueue/DefaultTest": {
"stacks": [
"aws-gamelift-gameSessionQueue"
],
"assertionStack": "GameSessionQueue/DefaultTest/DeployAssert",
"assertionStackName": "GameSessionQueueDefaultTestDeployAssert72367A40"
}
}
}
Loading