javikefi
06/07/2024, 11:02 AMmetaplay_tech
06/10/2024, 8:52 AMvivacious_quokka_56775_13574
06/10/2024, 9:23 AM# Install metaplay-auth CLI tool from NPM.
please go check https://www.npmjs.com/package/@metaplay/metaplay-auth
# Login with metaplay-auth CLI
metaplay-auth login
# Save deployment info into environmental variables
eval $(metaplay-auth get-aws-credentials -o <organization name> -p <project name> -e <environment name> -f env)
# Check if you have obtained AWS_ACCESS_KEY from metaplay-auth CLI
echo $AWS_ACCESS_KEY_ID # this should output a string
# Create AWS secrets with AWS CLI
aws secretsmanager create-secret --region eu-west-1 --name metaplay/p1/deployments/<project name>-<environment name>/<secret name> --secret-string <secret value>vivacious_quokka_56775_13574
06/10/2024, 9:26 AMjavikefi
06/10/2024, 9:32 AMjavikefi
06/10/2024, 9:55 AMvivacious_quokka_56775_13574
06/10/2024, 10:29 AMjavikefi
06/10/2024, 10:31 AMvivacious_quokka_56775_13574
06/10/2024, 10:32 AMvivacious_quokka_56775_13574
06/10/2024, 10:45 AMaws secretsmanager commands. Could you please try with this command and see if the same error still occurs?javikefi
06/10/2024, 10:47 AMjavikefi
06/10/2024, 10:48 AMvivacious_quokka_56775_13574
06/10/2024, 10:48 AMjavikefi
06/10/2024, 10:49 AMjavikefi
06/10/2024, 11:08 AMvivacious_quokka_56775_13574
06/10/2024, 11:48 AMgameserver, which binds to an IAM role gameserver that has these permission regarding to AWS Secrets:
- secretsmanager:GetSecretValue
- secretsmanager:DescribeSecret
- secretsmanager:ListSecretVersionIds
In short, your game server container should have access to AWS secrets on a fly without any additional configurations 🙂javikefi
06/10/2024, 12:11 PMjavikefi
06/10/2024, 12:13 PMvivacious_quokka_56775_13574
06/10/2024, 12:15 PMjavikefi
06/10/2024, 12:16 PMJurjen
06/10/2024, 12:32 PMJurjen
06/10/2024, 12:33 PMjavikefi
06/10/2024, 12:41 PMjavikefi
06/10/2024, 12:42 PMJurjen
06/10/2024, 12:42 PMjavikefi
06/10/2024, 12:43 PMjavikefi
06/10/2024, 12:44 PMvivacious_quokka_56775_13574
06/10/2024, 12:44 PMJurjen
06/10/2024, 12:45 PMvivacious_quokka_56775_13574
06/10/2024, 12:46 PMjavikefi
06/10/2024, 12:46 PMjavikefi
06/10/2024, 12:48 PMJurjen
06/10/2024, 12:52 PMAWS_PROFILE). This does still require that AWS_WEB_IDENTITY_TOKEN_FILE is not set. (It's a priority thing :/)
The AWS documentation is not very clear on this so it might require some tinkeringjavikefi
06/10/2024, 12:54 PMjavikefi
06/10/2024, 12:55 PMJurjen
06/10/2024, 12:55 PMSecretUtil.ResolveSecretAsync utility that can resolve AWS secrets, it has the same issues as your implementation (since it defers to AmazonSecretsManagerClient as well) but it might get rid of some boilerplate for youjavikefi
06/10/2024, 12:55 PMvivacious_quokka_56775_13574
06/10/2024, 12:56 PMjavikefi
06/10/2024, 12:56 PM