diff --git a/checkov/terraform/checks/resource/aws/ElasticBeanstalkUseEnhancedHealthChecks.py b/checkov/terraform/checks/resource/aws/ElasticBeanstalkUseEnhancedHealthChecks.py index ce3755339b..da3615ad7d 100644 --- a/checkov/terraform/checks/resource/aws/ElasticBeanstalkUseEnhancedHealthChecks.py +++ b/checkov/terraform/checks/resource/aws/ElasticBeanstalkUseEnhancedHealthChecks.py @@ -24,11 +24,11 @@ def scan_resource_conf(self, conf): namespace = setting.get("namespace") if isinstance(namespace, list) and namespace[0] == "aws:elasticbeanstalk:healthreporting:system": name = setting.get("name") - if isinstance(name, list) and name[0] == "HealthStreamingEnabled": + if isinstance(name, list) and name[0] == "SystemType": value = setting.get("value") if value and isinstance(value, list): value = value[0] - if value == "True" or (value and isinstance(value, bool)): + if value == "enhanced": return CheckResult.PASSED return CheckResult.FAILED diff --git a/tests/terraform/checks/resource/aws/example_ElasticBeanstalkUseEnhancedHealthChecks/main.tf b/tests/terraform/checks/resource/aws/example_ElasticBeanstalkUseEnhancedHealthChecks/main.tf index 52a4ff49d9..99f2c1bce8 100644 --- a/tests/terraform/checks/resource/aws/example_ElasticBeanstalkUseEnhancedHealthChecks/main.tf +++ b/tests/terraform/checks/resource/aws/example_ElasticBeanstalkUseEnhancedHealthChecks/main.tf @@ -36,14 +36,8 @@ resource "aws_elastic_beanstalk_environment" "fail3" { tags = local.tags setting { namespace = "aws:elasticbeanstalk:healthreporting:system" - name = "HealthStreamingEnabled" - value = "False" - } - - setting { - namespace = "guff" name = "SystemType" - value = "basic" + value = "" } } @@ -58,9 +52,8 @@ resource "aws_elastic_beanstalk_environment" "fail4" { tags = local.tags setting { namespace = "aws:elasticbeanstalk:healthreporting:system" - name = "HealthStreamingEnabled" - resource = "" - value = "" + name = "" + value = "enhanced" } } @@ -76,24 +69,8 @@ resource "aws_elastic_beanstalk_environment" "pass" { tags = local.tags setting { namespace = "aws:elasticbeanstalk:healthreporting:system" - name = "HealthStreamingEnabled" - value = "true" - } -} - -resource "aws_elastic_beanstalk_environment" "pass2" { - name = "beany" - application = var.elastic_beanstalk_application_name - description = var.description - tier = var.tier - solution_stack_name = var.solution_stack_name - wait_for_ready_timeout = var.wait_for_ready_timeout - version_label = var.version_label - tags = local.tags - setting { - namespace = "aws:elasticbeanstalk:healthreporting:system" - name = "HealthStreamingEnabled" - value = true + name = "SystemType" + value = "enhanced" } } diff --git a/tests/terraform/checks/resource/aws/test_ElasticBeanstalkUseEnhancedHealthChecks.py b/tests/terraform/checks/resource/aws/test_ElasticBeanstalkUseEnhancedHealthChecks.py index f2b45c9c3a..3634392137 100644 --- a/tests/terraform/checks/resource/aws/test_ElasticBeanstalkUseEnhancedHealthChecks.py +++ b/tests/terraform/checks/resource/aws/test_ElasticBeanstalkUseEnhancedHealthChecks.py @@ -17,7 +17,6 @@ def test(self): passing_resources = { "aws_elastic_beanstalk_environment.pass", - "aws_elastic_beanstalk_environment.pass2", } failing_resources = { "aws_elastic_beanstalk_environment.fail",