Skip to content

Commit

Permalink
fixing some other bugs in #1217
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandeivert committed Apr 1, 2020
1 parent 37c4d61 commit f039fac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion streamalert_cli/_infrastructure/modules/tf_athena/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "aws_sqs_queue" "data_bucket_notifications" {
receive_wait_time_seconds = 10

# The amount of time messages are hidden after being received from a consumer
visibility_timeout_seconds = format("%d", var.lambda_timeout + 2)
visibility_timeout_seconds = (var.lambda_timeout + 2)

# Retain messages for one day
message_retention_seconds = 86400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ variable "database_name" {
variable "queue_name" {
type = string
}

variable "lambda_timeout" {
type = number
}
1 change: 1 addition & 0 deletions streamalert_cli/terraform/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def generate_athena(config):
'queue_name': queue_name,
'athena_data_buckets': data_buckets,
'results_bucket': results_bucket_name,
'lambda_timeout': athena_config['timeout'],
'kms_key_id': '${aws_kms_key.server_side_encryption.key_id}',
'function_role_id': '${module.athena_partitioner_lambda.role_id}',
'function_name': '${module.athena_partitioner_lambda.function_name}',
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/conf/lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
}
},
"athena_partitioner_config": {
"memory": "128",
"timeout": "60",
"memory": 128,
"timeout": 60,
"file_format": "parquet",
"buckets": {
"bucket": "data"
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/streamalert_cli/terraform/test_athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_generate_athena():
"""CLI - Terraform Generate Athena Partitioner"""

CONFIG['lambda']['athena_partitioner_config'] = {
'timeout': '60',
'memory': '128',
'timeout': 60,
'memory': 128,
'third_party_libraries': []
}

Expand All @@ -46,6 +46,7 @@ def test_generate_athena():
'unit-test-streamalert-data',
'unit-test-streamalerts'
],
'lambda_timeout': 60,
'kms_key_id': '${aws_kms_key.server_side_encryption.key_id}',
'function_role_id': '${module.athena_partitioner_lambda.role_id}',
'function_name': '${module.athena_partitioner_lambda.function_name}',
Expand All @@ -63,9 +64,9 @@ def test_generate_athena():
'filename': 'athena_partitioner.zip',
'function_name': 'unit-test_streamalert_athena_partitioner',
'handler': 'streamalert.athena_partitioner.main.handler',
'memory_size_mb': '128',
'memory_size_mb': 128,
'source': './modules/tf_lambda',
'timeout_sec': '60',
'timeout_sec': 60,
}
}
}
Expand Down

0 comments on commit f039fac

Please sign in to comment.