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 CloudWatch Logs
docstr_tok: ["CLI","-","Terraform","Generate","CloudTrail","Module",",","With","CloudWatch","Logs"]
code: def test_generate_cloudtrail_with_cloudwatch_logs(self):
      """CLI - Terraform Generate CloudTrail Module, With CloudWatch Logs"""
      cluster_name = "advanced"
      self.config["clusters"]["advanced"]["modules"]["cloudtrail"] = {
          "s3_settings": {
              "enable_events": False,
          },
          "send_to_cloudwatch": True,
      }
      cloudtrail.generate_cloudtrail(
          cluster_name, self.cluster_dict, self.config
      )
  
      expected = {
          "cloudwatch_logs_destination_advanced": {
              "source": "./modules/tf_cloudwatch_logs_destination",
              "prefix": "unit-test",
              "cluster": "advanced",
              "regions": ["us-west-1"],
              "destination_kinesis_stream_arn": "${module.kinesis_advanced.arn}",
          },
          "cloudwatch_logs_destination_advanced_us-west-1": {
              "source": "./modules/tf_cloudwatch_logs_destination/modules/destination",
              "prefix": "unit-test",
              "cluster": "advanced",
              "account_ids": ["12345678910"],
              "destination_kinesis_stream_arn": "${module.kinesis_advanced.arn}",
              "cloudwatch_logs_subscription_role_arn": (
                  "${module.cloudwatch_logs_destination_advanced."
                  "cloudwatch_logs_subscription_role_arn}"
              ),
              "providers": {"aws": "aws.us-west-1"},
          },
          "cloudtrail_cloudwatch_advanced": {
              "source": "./modules/tf_cloudtrail/modules/tf_cloudtrail_cloudwatch",
              "cluster": "advanced",
              "prefix": "unit-test",
              "region": "us-west-1",
              "cloudwatch_destination_arn": (
                  "${module.cloudwatch_logs_destination_advanced_us-west-1."
                  "cloudwatch_logs_destination_arn}"
              ),
          },
          "cloudtrail_advanced": {
              "source": "./modules/tf_cloudtrail",
              "s3_cross_account_ids": ["12345678910"],
              "primary_account_id": "12345678910",
              "cluster": "advanced",
              "prefix": "unit-test",
              "region": "us-west-1",
              "s3_bucket_name": "unit-test-advanced-streamalert-cloudtrail",
              "s3_logging_bucket": "unit-test-streamalert-s3-logging",
              "cloudwatch_logs_role_arn": (
                  "${module.cloudtrail_cloudwatch_advanced.cloudtrail_to_cloudwatch_logs_role}"
              ),
              "cloudwatch_logs_group_arn": (
                  "${module.cloudtrail_cloudwatch_advanced.cloudwatch_logs_group_arn}"
              ),
          },
      }
  
      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 11 for calling the TestTerraformGenerate obj's underlying member method code with example usage: obj.test_generate_cloudtrail_with_cloudwatch_logs() without return types