Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 18, 2025

This PR adds a new health check package for AWS Elastic Compute Cloud (EC2) service, following the established patterns used by other AWS health check packages (S3, SQS, SNS).

What's Added

Core Implementation

  • ElasticComputeCloudHealthCheck: Uses DescribeRegionsAsync API to verify EC2 service connectivity
  • ElasticComputeCloudOptions: Configuration class supporting AWS credentials, region endpoint, service URL, and timeout settings
  • ElasticComputeCloudConfigure: Handles configuration binding from HealthChecks:AWSEC2 section with validation
  • DependencyInjectionExtensions: Provides AddAWSEC2() extension method with proper service registration
  • CreationMode: Enum for authentication modes (BasicAuthentication support)

Usage Examples

Configuration-based approach:

var builder = services.AddHealthChecks();
builder.AddAWSEC2("MyEC2Check");
{
  "HealthChecks": {
    "AWSEC2": {
      "MyEC2Check": {
        "Region": "us-west-2",
        "AccessKey": "...",
        "SecretKey": "...",
        "Timeout": 1000
      }
    }
  }
}

Builder-based approach:

builder.AddAWSEC2("MyEC2Check", options => {
    options.RegionEndpoint = RegionEndpoint.USWest2;
    options.AccessKey = "...";
    options.SecretKey = "...";
    options.Timeout = 1000;
});

Testing & Documentation

  • Unit tests: Complete test coverage following TUnit patterns with argument validation
  • Integration tests: LocalStack-based tests for both configuration and options approaches
  • Documentation: Comprehensive README with usage examples and configuration options
  • Bundle integration: Updated AWS bundle package to include EC2 health check

Project Structure

The implementation follows the exact same structure and naming conventions as existing AWS services:

  • Project references added to both unit and integration test projects
  • AWSSDK.EC2 package dependency included in integration tests
  • Consistent file organization and API design

The health check uses a lightweight DescribeRegionsAsync call with MaxResults = 1 to verify EC2 service connectivity while minimizing API overhead.

Fixes #52.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] NetEvolve.HealthChecks.AWS.EC2 Add NetEvolve.HealthChecks.AWS.EC2 health check package Aug 18, 2025
@Copilot Copilot AI requested a review from samtrion August 18, 2025 20:52
Copilot finished work on behalf of samtrion August 18, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NetEvolve.HealthChecks.AWS.EC2
2 participants