Skip to content

Commit

Permalink
re-added file test/integration/aws/cloudformation_validation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Mar 4, 2024
1 parent 41a0a48 commit 38cc460
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/integration/aws/cloudformation_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import subprocess


def validate_using_cfn_lint(tmp_path, cloudformation_yml):
"""
This test uses cfn-lint to validate the Cloudformation template.
(See https://github.com/aws-cloudformation/cfn-lint)
"""
out_file = tmp_path / "cloudformation.yaml"
with open(out_file, "w") as f:
f.write(cloudformation_yml)

completed_process = subprocess.run(["cfn-lint", str(out_file.absolute())], capture_output=True)
try:
completed_process.check_returncode()
except subprocess.CalledProcessError as e:
print(e.stdout)
raise e

0 comments on commit 38cc460

Please sign in to comment.