Skip to content

Commit

Permalink
Merge pull request airbnb#330 from airbnb/ryandeivert-stream-alert-ap…
Browse files Browse the repository at this point in the history
…p-fixes

[apps] bug fixes discovered during deploy
  • Loading branch information
ryandeivert authored Sep 29, 2017
2 parents 33dd27d + b208f9e commit 1759b2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app_integrations/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ def load_config(cls, context):

# Add the auth config info to the 'auth' key since these key/values can vary
# from service to service
base_config[cls.AUTH_CONFIG_SUFFIX] = params[param_names[cls.AUTH_CONFIG_SUFFIX]]
base_config[cls.AUTH_CONFIG_SUFFIX] = {
key: str(value) for key, value in
params[param_names[cls.AUTH_CONFIG_SUFFIX]].iteritems()
}

return AppConfig(base_config)

Expand Down
3 changes: 3 additions & 0 deletions stream_alert_cli/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def _publish_helper(self, **kwargs):
# Publish the function(s)
# TODO: move the extra logic into the LambdaPackage subclasses instead of this
if self.package.package_name == 'stream_alert_app':
if not 'stream_alert_apps' in self.config['clusters'][cluster]['modules']:
return True # nothing to publish for this cluster

for app_name, app_info in self.config['clusters'][cluster]['modules'] \
['stream_alert_apps'].iteritems():
# Name follows format: '<prefix>_<cluster>_<service>_<app_name>_app'
Expand Down
6 changes: 3 additions & 3 deletions terraform/modules/tf_stream_alert_app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ resource "aws_lambda_function" "stream_alert_app" {
description = "StreamAlert App for ${var.type}"
runtime = "python2.7"
role = "${aws_iam_role.stream_alert_app_role.arn}"
handler = "${var.stream_alert_apps_config["handler"]}"
handler = "${lookup(var.stream_alert_apps_config, "handler")}"
memory_size = "${var.app_memory}"
timeout = "${var.app_timeout}"
s3_bucket = "${var.stream_alert_apps_config["source_bucket"]}"
s3_key = "${var.stream_alert_apps_config["source_object_key"]}"
s3_bucket = "${lookup(var.stream_alert_apps_config, "source_bucket")}"
s3_key = "${lookup(var.stream_alert_apps_config, "source_object_key")}"

environment {
variables = {
Expand Down

0 comments on commit 1759b2c

Please sign in to comment.