Skip to content

Latest commit

 

History

History
76 lines (67 loc) · 3.82 KB

aws_backend_setup.md

File metadata and controls

76 lines (67 loc) · 3.82 KB

We want to:

  • upload our server build to AWS,
  • configure a fleet for it and
  • configure user pool, lambdas and rest_api to handle the login and session management

Steps

  1. Using the IAM Management Console, to create a profile to give to the aws_backend.py script.

    {
     "Version": "2012-10-17",
     "Statement": [
         {
             "Sid": "VisualEditor0",
             "Effect": "Allow",
             "Action": [
                 "gamelift:*",
                 "apigateway:*",
                 "cognito-idp:*",
                 "iam:GetRole",
                 "iam:PassRole",
                 "iam:PutRolePolicy",
                 "iam:DeleteRolePolicy",
                 "iam:CreateRole",
                 "iam:DeleteRole",
                 "lambda:*"
             ],
             "Resource": "*"
         }
      ]
    }
    
  2. I use a user called sean_gl, set permissions in IAM Management console and used aws configure import --csv file://new_user_credentials.csv to add the credentials for it on my PC.

  3. Tweak command line aws_backend.py to match your project

    1. Run aws_backend.py with no parameters. This will display the default settings. Tweak the following:

      Setting Purpose Example
      prefix represents a namespace for all of the other params potato
      build_root where to find the UE server build you want to push E:\unreal_projects\ue5_gamelift_plugin_test\MyProject\ServerBuild\WindowsServer
      fleet_launch_path the server exe to run C:/game/MyProject/Binaries/Win64/MyProjectServer.exe
      profile the iam profile to use dave
      region the aws region to use us-west-2

      By specifying them on the command line. e.g.

      aws_backend.py --prefix=potato --build_root=E:\unreal_projects\ue5_gamelift_plugin_test\MyProject\ServerBuild\WindowsServer -- fleet_launch_path=C:/game/MyProject/Binaries/Win64/MyProjectServer.exe --profile=dave --region=us-west-2

  4. Upload your build to GameLift

    1. Using the aws_backend.py command line you configured above add the command 'create build'. e.g.
    2. aws_backend.py --prefix=potato --build_root=E:\unreal_projects\ue5_gamelift_plugin_test\MyProject\ServerBuild\WindowsServer -- fleet_launch_path=C:/game/MyProject/Binaries/Win64/MyProjectServer.exe --profile=dave --region=us-west-2 create build
    3. Use the gamelift dashboard to verify your build has been uploaded build uploaded
  5. Start your fleet

    1. Using the aws_backend.py command line from above but this time use create fleet
    2. Use the gamelift dashboard to verify your fleet was created: fleet created
    3. If you see the error "botocore.errorfactory.LimitExceededException: An error occurred (LimitExceededException) when calling the CreateFleet operation: Current limit of fleets of 1 have been reached.", try specifying a different ec2 instance type. e.g. --fleet_ec2_instance_type=c5a.large
  6. Initialize the User Pool

    1. Using the aws_backend.py command line from above but this time use create user_pool
    2. Use the Amazon Cognito dashboard to verify your user pool was created: user pool created
  7. Install Lambdas

    1. Using the aws_backend.py command line from above but this time use create lambdas
    2. Use the Lambda dashboard to verify they were created lambdas created
  8. Install Rest API

    1. Using the aws_backend.py command line from above but this time use create rest_api
    2. The output will provide you with the invoke_url and instructions on how to test it using curl: curl_to_test_rest
    3. Make note of this invoke_url
    4. At this point the backend is all ready to go.