Honor AWS_ENDPOINT_URL_<SERVICE> env vars in generated Erlang clients#129
Conversation
Depends on aws_beam_core:apply_endpoint_url_override
|
@vulkoingim I'll leave it up to you if you wanna address my comments. If I don't hear back from you by tomorrow, I'll merge it anyway but I think my comments would be cleaner. At least the obsolete |
Co-authored-by: Onno Vos <onno-vos-dev@users.noreply.github.com>
Co-authored-by: Onno Vos <onno-vos-dev@users.noreply.github.com>
|
@vulkoingim Had to patch up the test and it now uses a somewhat broken env var for the Elixir test. For the sake of the test, it's fine 👍 So decided to merge and go ahead |
|
Will create the aws-erlang release shortly |
|
Hey @onno-vos-dev , the test was actually correct. I actually "verified" the change on my local machine after my last commit, but seems like I had a stale beam, so I basically did nothing 😅 Apologies for that. Should have looked better at the generated output :( But the format should be:
I've opened a PR to address this: #132 |
Depends on
aws_beam_core:apply_endpoint_url_overrideAs a disclosure I have used a LLM to generate the code, but I have tested and verified that the generated erlang lib compiles and works against:
AWS_ENDPOINT_URL_DYNAMODBAWS_ENDPOINT_URL_S3Generates
do_requestin the form:do_request(Client, Action, Input0, Options) -> Client1 = Client#{service => <<"dynamodb">>}, - Host = build_host(<<"dynamodb">>, Client1), - URL = build_url(Host, Client1), + DefaultHost = build_host(<<"dynamodb">>, Client1), + {URL, Host} = aws_util:apply_endpoint_url_override( + build_url(DefaultHost, Client1), DefaultHost, <<"/">>, + <<"AWS_ENDPOINT_URL_DYNAMODB">>), Headers = [ {<<"Host">>, Host}, {<<"Content-Type">>, <<"application/x-amz-json-1.0">>},Tested after generating the code, and patching the
aws_utilin aws-erlang.