Teardown all of the BinaryAlert infrastructure
(self)
| 164 | self.apply() |
| 165 | |
| 166 | def destroy(self) -> None: |
| 167 | """Teardown all of the BinaryAlert infrastructure""" |
| 168 | os.chdir(TERRAFORM_DIR) |
| 169 | |
| 170 | if not self._config.force_destroy: |
| 171 | result = get_input('Delete all S3 objects as well?', 'no') |
| 172 | |
| 173 | if result == 'yes': |
| 174 | print('Enabling force_destroy on the BinaryAlert S3 buckets...') |
| 175 | subprocess.check_call([ |
| 176 | 'terraform', 'apply', '-auto-approve=true', '-refresh=false', |
| 177 | '-var', 'force_destroy=true', |
| 178 | '-target', 'aws_s3_bucket.binaryalert_binaries', |
| 179 | '-target', 'aws_s3_bucket.binaryalert_log_bucket' |
| 180 | ]) |
| 181 | |
| 182 | subprocess.call(['terraform', 'destroy']) |
| 183 | |
| 184 | def live_test(self) -> None: |
| 185 | """Upload test files to BinaryAlert which should trigger YARA matches |