You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS GameLift SDK 5.0及以上版本Windows实例本地连接问题求助

解决GameLift 5.0+ SDK连接Windows实例的问题

核心说明

GameLift 5.0及以上版本改用get-compute-access后,该命令并非用于直接连接实例,它返回的临时凭证仅用于访问GameLift关联的S3存储(如构建包、实例日志)。连接Windows实例的官方推荐方式已改为SSM Session Manager,而非原有的RDP直接连接。

步骤1:用SSM Session Manager连接实例

  1. 确认权限与网络配置

    • 你的GameLift fleet所使用的IAM角色需包含AmazonSSMManagedInstanceCore权限(默认创建的角色已包含,可在IAM控制台检查)
    • 实例所在VPC的安全组需允许出站443端口访问SSM服务(目标地址:ssm.<你的区域>.amazonaws.com)
  2. 获取Compute实例信息
    替换原describe-instances命令,使用describe-compute获取实例ID:

    aws gamelift describe-compute --fleet-id <你的Fleet ID> --compute-name <Compute实例名称>
    

    从返回结果中提取对应的EC2实例ID(ec2InstanceId字段)

  3. 启动SSM会话连接
    使用AWS CLI执行以下命令,直接连接到Windows实例的PowerShell:

    aws ssm start-session --target <提取到的EC2实例ID>
    

步骤2:get-compute-access的正确用法

若需访问GameLift的S3存储,可使用get-compute-access返回的临时凭证:

  1. 将临时AccessKeyID、SecretAccessKey、SessionToken配置为AWS CLI临时profile:
    aws configure set aws_access_key_id <临时AccessKeyID> --profile gamelift-temp
    aws configure set aws_secret_access_key <临时SecretAccessKey> --profile gamelift-temp
    aws configure set aws_session_token <临时SessionToken> --profile gamelift-temp
    
  2. 访问指定S3路径(示例为fleet的存储桶):
    aws s3 ls s3://gamelift-<你的区域>-<你的AWS账号ID>/fleet-<你的Fleet ID>/ --profile gamelift-temp
    

可选:恢复RDP连接(不推荐)

若坚持使用RDP,需手动配置:

  • 更新fleet端口设置,开放3389端口给你的本地IP:
    aws gamelift update-fleet-port-settings --fleet-id <你的Fleet ID> --inbound-permissions "FromPort=3389,ToPort=3389,IpRange=<你的公网IP>/32,Protocol=TCP"
    
  • 通过SSM会话连接实例后,设置本地管理员密码:
    net user administrator <你的新密码>
    
  • 获取实例公网IP(若实例分配了公网IP),使用RDP客户端连接,用户名填administrator,密码为你设置的新密码

内容的提问来源于stack exchange,提问作者Omrum Cetin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 23:47:03