This message was deleted.
# helpdesk
s
This message was deleted.
a
cc @able-gigabyte-21598
a
it sounds like access key and/or secret aren’t being read properly. Is it formatted like this?
Copy code
s3:
  access_key: '****'
  secret: '****'
  region: us-east-1
  bucket: mybucket
g
I have set access_key and secret via the environment variables as detailed in the docs https://docs.livekit.io/oss/deployment/egress/#config
Ideally I'd prefer to leverage AWS IAM to save generating credentials
I notice the codebase expects static credentials. I've updated it locally to auto-configure for my environment, will feed back if this works!
This worked. Not sure on the impact of changing this in the livekit repo? (I'm maintaining a fork)
d
@able-gigabyte-21598 is it because we are not parsing the env vars correctly?
g
potentially, but from my experience with the AWS SDK if you're supplying static credentials directly, it won't be able to auto-configure from environment variables?
possibly environment variable expansion isnt happening in the config?
d
I think we should set those variables if they are non-empty. Perhaps you are using IAM roles, which wouldn't require anything to be set.
g
I am using IAM roles, but I did also statically set generated credentials in the environment variables. Making the code change and generated credentials (leveraging IAM) resolved the issue. I'd have to experiment further to validate, but it appeared it was not resolving the credentials via environment variables
a
ah, ok. I can add a
UseIAM
option to the s3 config that skips the static credentials
d
Maybe we should only set these fields if they are non-empty
?
a
I was considering that too, it should be fine as long as the error messaging is clear
d
i.e. I think having a
Credentials
field to point to static when AccessKey/Secret are empty
when it's set it prevents AWS from using IAM roles (if available)
a
right
what should the location in fileInfo return, if the region is taken from the IAM role?
we currently return
fmt.Sprintf("<https://%s.s3.>%<http://s.amazonaws.com/%s|s.amazonaws.com/%s>", conf.Bucket, conf.Region, storageFilepath)
d
I don't think region is needed. never had to specify that when accessing files in S3
<http://bucket.s3.amazonaws.com/key|bucket.s3.amazonaws.com/key>
should work
g
I think setting on non-empty is a good idea, I've taken similar approaches in the past to aid with things like testing