Instance metadata service, also known as imds, is a service in aws vpc instance, including gamelift fleet instance. With which we can use to get the instance's metadata on the server side.
imds with gamelift
In gamelift, we can generate an aws credential for each fleet instance.
To ask gamelift to generate an aws credentail for each fleet instance, we need to set instance role when we create the fleet.
We need to call get token with token ttl seconds first.
We can then call get ec2 instance security credentials with token to get aws credentials.
Or if we know the role name or we have gave the fleet multiple roles, we can use list role name with token to list all role names.
Then, we can use get IAM security credentials with token and role name to get the aws credentials.
To enable server mode in aws plugins, we can search
Target.Type != TargetRules.TargetType.Server
string below in aws plugin and replace them with
true
.