I’m using Fly containers via machine-config=, it’s working as expected (almost) but I can’t access the /.fly/oidc_token file that I need for a specific service.
[info]Error: operation error KMS: GetPublicKey, get identity: get credentials: failed to refresh cached credentials, failed to retrieve jwt from provide source, unable to read file at /.fly/oidc_token: open /.fly/oidc_token: no such file or directory
The good thing about containers is that they provide isolation. The bad thing about containers is that they provide isolation. In this case, you don’t have access to /.fly/oidc_token.
Instead you need to use our API to obtain this information:
Here is an example of how you would use this with AWS:
It works, but seems that it’s also accessible from other containers.
For ex.:
I define 3 containers, but want only one of them to have AWS credentials, when I run the command that fills the /.fly/oidc_token this file will be acessible for other containers.
I understand that some part of the fly machine init process is already preparing the environment, since I get AWS_ROLE_SESSION_NAME, and AWS_WEB_IDENTITY_TOKEN_FILE environment variables created by only defining the AWS_ROLE_ARN, but the file is not filled with the content when I use containers.