How to extract/pick latest json file from list of files from S3 bucket and folder

I wanted to get information like latest deployed version from swagger.json file for service. But we have list of json files in folder need to pick latest version of json file and get the version deployed from json content and display it to Datadog dashboard. Any solution appreciated

This question seems off topic and Terraform is likely not the right tool for the job. But to answer your question about S3, maybe you can use aws s3 ls in a shell script or the SDK equivalent for further sorting/filtering. Hope this helps and good luck.

1 Like