Hacker News new | past | comments | ask | show | jobs | submit login

Request for anyone on the Lambda team who happens to read this: your API doesn’t appear to offer a way to retrieve the “last modified by” user when grabbing function metadata.

Very unlike other AWS APIs and very annoying.




Which API specifically are you referring to (GetFuntionConfiguration ?), and which APIs are you comparing it against?


Examples of APIs that provide a "LastModifiedUser" result:

* https://docs.aws.amazon.com/systems-manager/latest/APIRefere...

Huh. Turns out fewer of the ones I use than I thought provide that level of detail. That just happens to be the closest approximation of what I'm currently trying to automate.

Anyway, there are several API endpoints in Lambda which supply "LastModified" but none that I can find supply "LastModifiedUser".

* https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction...

* https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction...

* https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctio...


There are other oddities too. For example, to get a layer name from a lambda definition, the simplest/most robust process I can define:

1 Retrieve all layers with list_layers and index them by ARN

2 Retrieve all function metadata

3 For each function metadata item, extract all layer version ARNs

4 For each layer version ARN, call get_layer_version_by_arn

5 Extract the layer ARN from that result

6 Use that layer ARN to retrieve the name from the data we retrieved in step 1


Layer Name and Layer Arn (the Layer Version Arn without a version suffix) are interchangeable in APIs that require a Layer Name parameter. I understand that you're trying to extract the "LayerName" field returned in the API response in ListLayers, but you can do it more concisely.

If you just need the Layer Arn to call other APIs:

a) You could eliminate steps 1 and 6, and use the Layer Arn value from 5 to call APIs that require a layer name.

b) Alternatively, you could yourself chop off the version number from the Layer Version Arn string(s) in step 4, and skip the GetLayerVersionByArn call in step 5 all together.

If you explicitly require the name, not the Layer Arn:

c) You could parse it right out of the Layer Version Arn yourself.

When it comes to doing your own string manipulation for (b) or (c), there are many ways to skin a cat ... but you could use regex (the pattern is in the API documentation), or split on colons and index the second to last element in the array.

Is it useful to return the Layer Name in more APIs? What is your use-case?


Sorry, been away from this for a while. This is for a dashboard (we have many accounts and not all stakeholders have permissions across all accounts, so we need ways to manage the information outside the web console).

I am reluctant to treat ARNs as anything but opaque blobs; I do so when necessary, but I know their format has changed in the past, and the lack of a central resource to track breaking changes across AWS means that we would likely not know that the ARN format is changing until our tools break.

I appreciate the ideas, however, and I'll look more closely at my flow to see what shortcuts I can live with.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: