Exemple #1
0
 def test_failure_default(self):
     hcl_res = hcl2.loads("""
             resource "google_storage_bucket" "static-site" {
               name          = "image-store.com"
               location      = "EU"
               force_destroy = true
             }
             """)
     resource_conf = hcl_res['resource'][0]['google_storage_bucket'][
         'static-site']
     scan_result = check.scan_resource_conf(conf=resource_conf)
     self.assertEqual(CheckResult.FAILED, scan_result)
Exemple #2
0
 def test_success_bucket_uniform(self):
     hcl_res = hcl2.loads("""
                      resource "google_storage_bucket" "static-site" {
                        name          = "image-store.com"
                        location      = "EU"
                        force_destroy = true
                        uniform_bucket_level_access = true
                      }
                      """)
     resource_conf = hcl_res['resource'][0]['google_storage_bucket'][
         'static-site']
     scan_result = check.scan_resource_conf(conf=resource_conf)
     self.assertEqual(CheckResult.PASSED, scan_result)