hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Make our SSM Parameter Store script more robust to underlying JSON schema changes #221

Open MikeTheCanuck opened 6 years ago

MikeTheCanuck commented 6 years ago

We've talked about this on Slack as a result of the troubleshooting of #220. The guidance and sample code suggested by @DingoEatingFuzz is an approach like this:

https://gist.github.com/DingoEatingFuzz/3af0514e7c8001bcc0fcb4e42fb033bf

Code hasn't been tested and may not entirely work, but it's a helluva starting place.

An approach like this would ensure two things:

  1. that any further changes to the underlying JSON schema shouldn't break our containers, because this operates on the canonical json output
  2. This way we make only one aws cli request to get everything back

Plus who doesn't prefer python's readability over bash's terse and cryptic nature?

Task: to take this sample code, test it against an environment like the HackOregon CloudFormation approach, and if needed refactor it until it can be a drop-in replacement for get-ssm-parameters.sh in the production-docker-entrypoint.sh script each API project uses.