File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ type Config struct {
2424 RenderAPIKey string `required:"true" split_words:"true"`
2525 AWSRegion string `required:"true" split_words:"true"`
2626
27- // If AWSRoleARN is empty, the AWS SDK falls back to access keys from the environment
27+ // OIDC is used if the web identity token file exists on disk (mounted by
28+ // Render when OIDC is enabled). Otherwise the AWS SDK's default credential
29+ // chain falls back to AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY.
2830 AWSRoleARN string `required:"false" split_words:"true"`
2931 AWSWebIdentityTokenFile string `required:"false" split_words:"true" default:"/var/lib/render/oidc/aws.jwt"`
3032
@@ -49,7 +51,8 @@ func LoadConfig(ctx context.Context, config *Config) error {
4951 return err
5052 }
5153
52- if config .AWSRoleARN != "" {
54+ if _ , err := os .Stat (config .AWSWebIdentityTokenFile ); err == nil {
55+ logger .FromContext (ctx ).Info ("Using OIDC authentication" )
5356 awscfg .Credentials = aws .NewCredentialsCache (stscreds .NewWebIdentityRoleProvider (
5457 sts .NewFromConfig (awscfg ),
5558 config .AWSRoleARN ,
You can’t perform that action at this time.
0 commit comments