@@ -566,6 +566,111 @@ terraform.moved_blocks({"from": "any"}, {})
566566]
567567```
568568
569+ ## ` terraform.imports `
570+
571+ ``` rego
572+ blocks := terraform.imports(schema, options)
573+ ```
574+
575+ Returns Terraform imports blocks.
576+
577+ - ` schema ` (schema): schema for attributes referenced in rules.
578+ - ` options ` (object[ string: string] ): options to change the retrieve/evaluate behavior.
579+
580+ Returns:
581+
582+ - ` blocks ` (array[ object<config: body, decl_range: range>] ): Terraform "import" blocks.
583+
584+ The ` schema ` and ` options ` are equivalent to the arguments of the ` terraform.resources ` function.
585+
586+ Examples:
587+
588+ ``` hcl
589+ import {
590+ to = aws_instance.example
591+ id = "i-abcd1234"
592+ }
593+ ```
594+
595+ ``` rego
596+ terraform.imports({"id": "string"}, {})
597+ ```
598+
599+ ``` json
600+ [
601+ {
602+ "config" : {
603+ "id" : {
604+ "value" : " i-abcd1234" ,
605+ "unknown" : false ,
606+ "sensitive" : false ,
607+ "range" : {... }
608+ }
609+ },
610+ "decl_range" : {... }
611+ }
612+ ]
613+ ```
614+
615+ ## ` terraform.checks `
616+
617+ ``` rego
618+ blocks := terraform.checks(schema, options)
619+ ```
620+
621+ Returns Terraform check blocks.
622+
623+ - ` schema ` (schema): schema for attributes referenced in rules.
624+ - ` options ` (object[ string: string] ): options to change the retrieve/evaluate behavior.
625+
626+ Returns:
627+
628+ - ` blocks ` (array[ object<config: body, decl_range: range>] ): Terraform "check" blocks.
629+
630+ The ` schema ` and ` options ` are equivalent to the arguments of the ` terraform.resources ` function.
631+
632+ Examples:
633+
634+ ``` hcl
635+ check "health_check" {
636+ data "http" "terraform_io" {
637+ url = "https://www.terraform.io"
638+ }
639+
640+ assert {
641+ condition = data.http.terraform_io.status_code == 200
642+ error_message = "${data.http.terraform_io.url} returned an unhealthy status code"
643+ }
644+ }
645+ ```
646+
647+ ``` rego
648+ terraform.checks({"assert": {"condition": "bool"}}, {})
649+ ```
650+
651+ ``` json
652+ [
653+ {
654+ "config" : {
655+ "assert" : [
656+ {
657+ "config" : {
658+ "condition" : {
659+ "unknown" : true ,
660+ "sensitive" : false ,
661+ "range" : {... }
662+ }
663+ },
664+ "labels" : null ,
665+ "decl_range" : {... }
666+ }
667+ ]
668+ },
669+ "decl_range" : {... }
670+ }
671+ ]
672+ ```
673+
569674## ` terraform.module_range `
570675
571676``` rego
0 commit comments