Skip to content

Commit

Permalink
[cli] fix undeclared module issue related to artifact_extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chunyong Lin committed Jun 10, 2020
1 parent aaa1f06 commit 7923eec
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions streamalert_cli/terraform/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,16 @@ def terraform_generate_handler(config, init=False, check_tf=True, check_creds=Tr
os.path.join(TERRAFORM_FILES_PATH, 'main.tf.json')
)

# Setup Artifact Extractor if it is enabled.
# artifact_extractor module is referenced in main.tf.json, so we need to generate it is tf file
# right after generating main.tf.json file for "manage.py destroy" command.
generate_global_lambda_settings(
config,
conf_name='artifact_extractor_config',
generate_func=generate_artifact_extractor,
tf_tmp_file_name='artifact_extractor'
)

# Return early during the init process, clusters are not needed yet
if init:
return True
Expand Down Expand Up @@ -514,14 +524,6 @@ def terraform_generate_handler(config, init=False, check_tf=True, check_creds=Tr
# Setup StreamQuery
_generate_streamquery_module(config)

# Setup Artifact Extractor if it is enabled
generate_global_lambda_settings(
config,
conf_name='artifact_extractor_config',
generate_func=generate_artifact_extractor,
tf_tmp_file_name='artifact_extractor'
)

return True


Expand Down

0 comments on commit 7923eec

Please sign in to comment.