Created
May 4, 2022 11:51
-
-
Save Warrenn/856defce94e2d3d899f5884d5e5a0a8d to your computer and use it in GitHub Desktop.
FallbackCredentialsFactory.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FallbackCredentialsFactory.CredentialsGenerators.Insert(0, () => | |
| { | |
| var profileName = Environment.GetEnvironmentVariable("AWS_PROFILE"); | |
| if (string.IsNullOrWhiteSpace(profileName)) return null; | |
| var chain = new CredentialProfileStoreChain(); | |
| return !chain.TryGetProfile(profileName, out var profile) ? null : new BasicAWSCredentials(profile.Options.AccessKey, profile.Options.SecretKey); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment