Skip to content

[Feature] AWS provider: honor AWS_ENDPOINT_URL / endpoint override (published async provider) for local emulators #991

Description

@lex00

Problem

Alchemy's AWS provider hardcodes the regional AWS endpoint at each service call site — e.g. packages/alchemy/src/AWS/.../ec2 builds https://ec2.${region}.amazonaws.com/ — and nothing reads AWS_ENDPOINT_URL. AwsClientProps exposes credentials and region but no endpoint. So there is no way to point the AWS resources at a local emulator (LocalStack, or an AWS-shaped emulator) or a custom endpoint.

This makes AWS resources untestable without deploying to real AWS. Terraform, Pulumi, CDK, and the AWS SDK all honor AWS_ENDPOINT_URL (or an endpoint option), which is what lets them run against a local emulator for free in CI.

Note: the Effect line (alchemy/AWS) already has AWS.Endpoint.of(url). This request is for the published async provider (alchemy/aws/*, npm 0.93.12), which has no equivalent.

Request

Honor an endpoint override for the AWS provider, resolved in this order:

  • an endpoint field on AwsClientProps (resource/scope level), then
  • the AWS_ENDPOINT_URL environment variable.

When set, use it as the base URL for every service call (keeping the SigV4 service/region in the credential scope so emulators route correctly), instead of https://<service>.<region>.amazonaws.com.

Why

Enables local, $0 testing of AWS infra against an emulator — the same loop Alchemy already champions for Cloudflare via Miniflare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions