-
Notifications
You must be signed in to change notification settings - Fork 867
Open
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.module/sdk-generatedp2This is a standard priority issueThis is a standard priority issuequeued
Description
Describe the feature
There is a way for most of the services to add them with extension method TryAddAwsService
/ TryAddAWSService
, depending whether there's usage of LocalStack
involved or not, but not for IAmazonApiGatewayManagementApi
... As I couldn't find a way to configure ServiceURL
, except explicitly adding the service as a Transient
and providing new object initialization lambda definition as a parameter as shown in example:
public static IServiceCollection AddService(this IServiceCollection services, IConfiguration configuration)
{
return services
.AddLocalStack(configuration)
.AddDefaultAWSOptions(configuration.GetAWSOptions())
.AddTransient<IAmazonApiGatewayManagementApi>(_ =>
new AmazonApiGatewayManagementApiClient(
new AmazonApiGatewayManagementApiConfig
{
ServiceURL = "wss://someurl"
}));
}
Is there more authentic way to add the interface in a service collection using TryAddAwsService
and configure ServiceURL
?
I'm searching for something similar to this:
public static IServiceCollection AddService(this IServiceCollection services, IConfiguration configuration)
{
return services
.AddLocalStack(configuration)
.AddDefaultAwsOptions(configuration.GetAWSOptions())
.Configure<AmazonApiGatewayManagementApiConfig>(config =>
{
config.ServiceURL = "wss://someurl";
})
.TryAddAwsService<IAmazonApiGatewayManagementApi>(ServiceLifetime.Transient);
}
But obviously this code doesn't work....
Use Case
I want to add IAmazonApiGatewayManagementApi
in IoC container and configure it.
Proposed Solution
No response
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
Latest
Targeted .NET Platform
.NET 6
Operating System and version
Any
Metadata
Metadata
Assignees
Labels
feature-requestA feature should be added or improved.A feature should be added or improved.module/sdk-generatedp2This is a standard priority issueThis is a standard priority issuequeued