Skip to content

Commit

Permalink
Updated creds retrieval logic from @samritchie
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Apr 8, 2022
1 parent 4ca36df commit d68a400
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/FSharp.AWS.DynamoDB/Script.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ open FSharp.AWS.DynamoDB
open FSharp.AWS.DynamoDB.Scripting // non-Async overloads

#if USE_CLOUD
open Amazon
open Amazon.Util
let account = AWSCredentialsProfile.LoadFrom("default").Credentials
let ddb = new AmazonDynamoDBClient(account, RegionEndpoint.EUCentral1) :> IAmazonDynamoDB
open Amazon.DynamoDBv2
let ok, creds = CredentialProfileStoreChain().TryGetAWSCredentials("default")
let ddb = if ok then new AmazonDynamoDBClient(creds) :> IAmazonDynamoDB else failwith "Unable to load default credentials"
#else // Use Docker-hosted dynamodb-local instance
// See https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html#docker for details of how to deploy a simulator instance
#if USE_CREDS_FROM_ENV_VARS // 'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY' must be set for this to work
Expand Down

0 comments on commit d68a400

Please sign in to comment.