Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bsweger/add hub specific lambda infra (#38)
* Create an S3 bucket for storing shared hubverse assets This is where we'll plan to publish the data transformation function that we want to run via Lambda * Add function to create the model-output transform lambda Create the lamba that will be triggered when new model-output files are pushed to a hub's S3 bucket. This definition points to a lambda package on S3 (rather than defining the function code inline). Another repo will be responsible for creating the the lambda package and deploying to the s3 bucket. * Make the S3 location of the lambda package easier to find and change It's still hard-coded, but it's hard-coded in a better place, with some CloudPath magic sprinkled in for more robust path parsing. * Move permissions components of lambda to their own function This changeset also creates an IAM policy to allows writes to CloudWatch logs and attaches that policy to the IAM role assumed by our hubverse-transform lambda function. * Specify that lambda role can only be assumed by a specific function * Create a placeholder lambda package on S3 Annoyingly, the "create lambda" function will fail if it's pointing to a lambda code package that doesn't yet exist on S3. It creates a chicken-and-egg problem for us, since we haven't deployed the transform function's code to S3 yet. Might be overkill, but this changeset creates a placeholder .zip to use as lambda code package until we have the official deployment pipeline up and running (in the hubverse-transform repo) * Remove an unsed test hub from the config Not relate to the current lambda work, but because I removed the related assets from our Pulumi stack, they'll be recreated unless the config is updated. * Update README and do a little cleanup * Tell mypy to ignore CloudPath.key Mypy fails in GitHub CI on CloudPath.key (which not only works, it passes the mypy check locally and in pre-commit). Gonna ignore this one instead of trying to run it down. * Give the transform-model-output lambda permission to write to hubs' S3 Noting that there's a limit of 10 policies per IAM role, so once we're hosting more than a few hubs, we'll need to request a limit increase. * Trigger the hubverse transform lambda when model-ouput files arrive For each hub being created, add an S3 ObjectCreated trigger that will invoke the hubverse-transform-model-output transform. * Don't typecheck Cloudpath class
- Loading branch information