cloudydeno / deno-aws_api

From-scratch Typescript client for accessing AWS APIs
https://deno.land/x/aws_api
59 stars 3 forks source link

Support for ECSCredentials #33

Closed Larisho closed 2 years ago

Larisho commented 2 years ago

We're trying to use this package in a deno app deployed via ECS and we're getting credential errors when trying to connect to dynamodb. On inspection of lib/client/credentials.ts, I noticed that ECSCredential handling is commented out/not included.

https://github.com/cloudydeno/deno-aws_api/blob/a383db0f0793f0211be46f039ccce9b3e49f8974/lib/client/credentials.ts#L55

Adding support for this would be really helpful.

danopia commented 2 years ago

Hello, thank you for the request! I haven't had an ECS environment handy, which meant I couldn't have verified the code if I had written it already.

I'll put together an implementation and respond here so you could ideally verify it in your environment. That would help me be confident about merging it into main and shipping a new minor version.

Larisho commented 2 years ago

That would be great. Really appreciate it

danopia commented 2 years ago

Hi again, not sure how convenient it is for you to verify a raw version from an open PR. I made a small get-ecs-identity.ts example which can be run directly:

deno run --no-prompt --allow-env --allow-net https://gist.githubusercontent.com/danopia/36788750e91fb721ad4d61bc33a61e2c/raw/a4a3adba8ad512055bdda05b2e9fd48190e05e95/get-ecs-identity.ts

I did some sanity checks locally but I haven't seen a full example response from ECS so there's a little bit of guessing. Let me know if you aren't able to verify and I could try briefly running ECS in my own account instead.

Larisho commented 2 years ago

I've verified that it works on our ECS. Thanks!