diff --git a/CHANGELOG.md b/CHANGELOG.md index e80de72a..dfdf5bbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Added an auto-detection mechanism for terraform version while converting the plan. ([#365](https://github.com/terraform-compliance/cli/issues/365) [#273](https://github.com/terraform-compliance/cli/issues/273) [#381](https://github.com/terraform-compliance/cli/issues/381) [MicrosoftDocs/azure-dev-docs#396](https://github.com/MicrosoftDocs/azure-dev-docs/pull/396) [documentation](https://terraform-compliance.com/pages/usage/#-tv---terraform-version)) * Updated the hashicorp public key. ([#475](https://github.com/terraform-compliance/cli/issues/475)) +* Fixed a problem where child_modules where not parsed in the plan file. ([#478](https://github.com/terraform-compliance/cli/issues/478)) ## 1.3.15 (2020-05-12) * Fixed an issue where [exclude resources tag](https://terraform-compliance.com/pages/bdd-references/using_tags.html#exclude-resources) were breaking due to improper `step_obj` creation from `Given` step. ([#468](https://github.com/terraform-compliance/cli/issues/468)) diff --git a/terraform_compliance/common/terraform_files.py b/terraform_compliance/common/terraform_files.py index 67fb1bc2..b348d77f 100644 --- a/terraform_compliance/common/terraform_files.py +++ b/terraform_compliance/common/terraform_files.py @@ -132,10 +132,14 @@ def download_terraform(version): def detect_required_terraform_version(string): - match = re.search(r'([0-9.]+), but this is ([0-9.]+); plan files cannot be transferred between', - string, re.DOTALL) - - if match is not None: - return match.group(1), match.group(2) + match_regex = [ + r'([0-9.]+), but this is ([0-9.]+); plan files cannot be transferred between', + r'by Terraform v([0-9.]+), which is newer than current v([0-9.]+);' + ] + for pattern in match_regex: + match = re.search(pattern, string, re.DOTALL) + + if match is not None: + return match.group(1), match.group(2) return None, None \ No newline at end of file