class_docstr: Test class for the Terraform Cluster Generating
class_docstr_tok: ["Test","class","for","the","Terraform","Cluster","Generating"]
docstr: CLI - Terraform Generate CloudTrail Module, With S3 Events
docstr_tok: ["CLI","-","Terraform","Generate","CloudTrail","Module",",","With","S3","Events"]
code: def test_generate_cloudtrail_with_s3_events(self):
      """CLI - Terraform Generate CloudTrail Module, With S3 Events"""
      cluster_name = "advanced"
      self.config["clusters"]["advanced"]["modules"]["cloudtrail"] = {
          "s3_settings": {
              "bucket_name": "unit-test-bucket",
              "cross_account_ids": ["456789012345"],
              "enable_events": True,
          },
          "send_to_cloudwatch": False,
      }
      cloudtrail.generate_cloudtrail(
          cluster_name, self.cluster_dict, self.config
      )
  
      expected = {
          "cloudtrail_advanced": {
              "source": "./modules/tf_cloudtrail",
              "s3_cross_account_ids": ["12345678910", "456789012345"],
              "primary_account_id": "12345678910",
              "cluster": "advanced",
              "prefix": "unit-test",
              "region": "us-west-1",
              "s3_bucket_name": "unit-test-bucket",
              "s3_logging_bucket": "unit-test-streamalert-s3-logging",
          },
          "cloudtrail_s3_events_unit-test_advanced_unit-test-bucket": {
              "source": "./modules/tf_s3_events",
              "lambda_role_id": "${module.classifier_advanced_lambda.role_id}",
              "lambda_function_alias": "${module.classifier_advanced_lambda.function_alias}",
              "lambda_function_alias_arn": (
                  "${module.classifier_advanced_lambda.function_alias_arn}"
              ),
              "lambda_function_name": "${module.classifier_advanced_lambda.function_name}",
              "bucket_name": "unit-test-bucket",
              "filters": [
                  {"filter_prefix": "AWSLogs/12345678910/CloudTrail/"},
                  {"filter_prefix": "AWSLogs/456789012345/CloudTrail/"},
              ],
          },
      }
  
      assert_equal(expected, self.cluster_dict["module"])
  
imports: from mock import ANY, Mock, patch
  from nose.tools import assert_equal, assert_dict_equal, assert_false, assert_raises, assert_true
  from streamalert.shared.exceptions import ConfigError
  from streamalert_cli.config import CLIConfig
  from streamalert_cli.terraform import common, cloudtrail, cloudwatch_destinations, cloudwatch_events, flow_logs, generate
label_desc: Use image node_id 10 for calling the TestTerraformGenerate obj's underlying member method code with example usage: obj.test_generate_cloudtrail_with_s3_events() without return types