File: Provisioning\AWSResourceProvisionerOfT.cs
Web Access
Project: src\src\Aspire.Hosting.AWS\Aspire.Hosting.AWS.csproj (Aspire.Hosting.AWS)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Aspire.Hosting.AWS.Provisioning;
 
internal interface IAWSResourceProvisioner
{
    Task GetOrCreateResourceAsync(IAWSResource resource, CancellationToken cancellationToken = default);
}
 
internal abstract class AWSResourceProvisioner<TResource> : IAWSResourceProvisioner
    where TResource : IAWSResource
{
    public Task GetOrCreateResourceAsync(
        IAWSResource resource,
        CancellationToken cancellationToken)
        => GetOrCreateResourceAsync((TResource)resource, cancellationToken);
 
    protected abstract Task GetOrCreateResourceAsync(TResource resource, CancellationToken cancellationToken);
}