Simple service discovery for .NET Aspire and Hashicorp Nomad
Add package ServiceDiscovery.Nomad to your Aspire ServiceDefaults project.
dotnet add package ServiceDiscovery.NomadIn your Aspire ServiceDefaults project, replace the following:
~~builder.Services.AddServiceDiscovery();~~with
builder.Services.AddNomadServiceDiscovery();and you're good to go.
ServiceDiscovery.Nomad uses the Nomad environment variables NOMAD_ADDR_* to connect to the correct service. Simple, right?