Implements a v2 Lambda Output with AssumeRole#1227
Conversation
| "aws-lambda": { | ||
| "sample-lambda": "function-name:qualifier" | ||
| }, | ||
| "aws-lambda-v2": [ |
There was a problem hiding this comment.
IIRC, this is not actually how this info will be written to the outputs.json config file for AWSOutput types .. see here:
streamalert/streamalert/alert_processor/outputs/aws.py
Lines 50 to 69 in 41da6b5
did you confirm that this actually works as expected with the manage.py outputs new ... command?
There was a problem hiding this comment.
Oh wow, no this is totally not gonna work. Good catch. No I didn't confirm it as I'm still testing it, but it's good to know that it's definitely wrong.
I think the easy fix is to just not inherit from this base class and just use the OutputDispatcher base class like any other sane output.
There was a problem hiding this comment.
agreed - we can trend away from the AWSOutput class usage for future aws outputs now that ssm is a thing
ryandeivert
left a comment
There was a problem hiding this comment.
lgtm with one curiosity/question
|
I got this to work with Terraform configurations that look like: |
* bumping version to 3.2.0 * migrating Athena function to use tf_lambda module (#1217) * rename of athena function * updating terraform generation code to use tf_lambda module * updating tf_athena module to remove lambda code * updates for packaging, rollback, and deploy * misc updates related to config path renaming, etc * removing no-longer-used method (athena is default) * addressing PR feedback * adding more granular time prefix to athena client * fixing duplicate resource issues (#1218) * fixing duplicate resource issues * fixing some other bugs in #1217 * fixing tf targets for athena deploy (#1220) * adding "--config-dir" flag to CLI to support specifying path for config files (#1224) * adding support for supplying path to config via CLI flag * misc touchups * updating publishers to accept configurable paths (#1223) * moving matchers outside of rules directory * updating rules for new matcher path * updating unit test for consistency * making publisher locations configurable * fixing typo * updating tf_lambda module to remove extra resources (#1225) * fixing rollback for all functions, removing 'all' flag for function deploys (#1222) * updating rollback functionality to include all funcs * updating tests to check for rollback of all funcs * updating docs * fixing tf cycle and index issue (#1226) * Add missing dependency (#1228) * Implements a v2 Lambda Output with AssumeRole (#1227) * First draft of aws-lambda-v2 * Tests * Fixup * Fixup * Fioxup * Fixup * fixup * adding terraform references for some buckets (#1229) * adding athena terraform references instead of literals * fixing tests * GitHub Actions (#1231) * port to github actions * remove travis * cover the 3.2 branch for now too * initial updates to simplify lambda packaging logic (#1232) * moving some precompiled files * initial revamp to packaging to remove multiple pacakges * taking out more trash * update scheduled queries module * updating deploy logic to suck garbage slightly less * updates to unit tests * addressing pr feedback * addressing PR feedback * small update to docs (#1233) Co-authored-by: Ryxias <derek.wang@airbnb.com> Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
to: @ryandeivert @blakemotl @chunyong-lin
cc: @airbnb/streamalert-maintainers
Background
We needed to be able to invoke Lambda across AWS accounts. The problem is the existing Lambda output seems to be.. wrong. It doesn't derive configs from the right place.
Instead of breaking reverse compatibility, I just added a v2 that is easier to set up and is more consistent with existing implementations. This v2 also has the ability to make
sts:AssumeRolecalls, in order to make Lambda invocations across accounts. However, it assumes that you already set up the IAM Policies correctly.Testing
Tested on stage; built a test lambda and was able to invoke it.