danielgerlag / danielgerlag/workflow-core
Supply an already configured dynamo client to the dynamo locking provider
- Dominant language
- C#
- Stars
- 5.9k
- Forks
- 1.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 5
Description
**Cannot use the Dynamo Lock Provider as it requires a pre specified set of credentials**
We don't use explicit credentials in our AWS stack, we use roles - in fact using credentials in an AWS application is not a great practice. The application stack accesses other AWS resources via the it's role, and not via credentials. The current set of workflow core AWS providers expect a set of credentials and this is blocking us from using the Dynamo locking provider as we will not be provisioning explicit credentials.
**Describe the solution you'd like**
An additional extension method like
```
public static WorkflowOptions UseAwsDynamoLockingWithProvidedDynamoClient(this WorkflowOptions options, AmazonDynamoDBClient dynamoClient, string tableName)
{
options.UseDistributedLockManager(sp => new DynamoLockProvider(dynamoClient, tableName, sp.GetService(), sp.GetService()));
return options;
}
which calls an alternate constructor on DynamoLockProvider
``` public DynamoLockProvider(AmazonDynamoDBClient dynamoClient, string tableName, ILoggerFactory logFactory, IDateTimeProvider dateTimeProvider)
{
_logger = logFactory.CreateLogger();
_client = dynamoClient;
_localLocks = new List();
_tableName = tableName;
_nodeId = Guid.NewGuid().ToString();
_dateTimeProvider = dateTimeProvider;
}
```
```
**Describe alternatives you've considered**
We could provision client credentials but this is an anti pattern and poor practice. We're stuck unless we use the redis provider. Redis is not our sensible default for this kind of thing and adds $ to our infrastructure cost
**Additional context**
Add any other context or screenshots about the feature request here.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.