Home > Net >  Boto3: Lambda Get lastRecordedPullTime in the return
Boto3: Lambda Get lastRecordedPullTime in the return

Time:10-18

As specified in Boto3 documentation, if I use describe_image I should get a of informations, more importantly, lastRecordedPullTime.

But when I use it in my Lambda, I only get a little 8 out of 11 informations. When I use aws-cli, I do get all the informations, included lastRecordedPullTime.

Did I miss something ?

dictKwarg = {'nextToken':nextTk, 'maxResults':1000, 'repositoryName':repository}
images = ecrClient.describe_images(**dictKwarg)
for img in images['imageDetails']:
    for k,v in img.items():
        print(f"{k}")

returns:

  1. registryId
  2. repositoryName
  3. imageDigest
  4. imageTags
  5. imageSizeInBytes
  6. imagePushedAt
  7. imageManifestMediaType
  8. artifactMediaType

Thanks!

CodePudding user response:

boto3 in a lambda function is not a full version and often its not up to date. Thus, it is quite common for some parameters and attributes to be missing. Thus, you should bundle latest boto3 in your function yourself, for example in a lambda layer.

If you do not want to make your own layer, you can try using publicly available ones, such as from here.

  • Related