diff --git a/docs/resources/enforcement_rule.md b/docs/resources/enforcement_rule.md index 6f9f7a0..0a05d58 100644 --- a/docs/resources/enforcement_rule.md +++ b/docs/resources/enforcement_rule.md @@ -1,16 +1,63 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "bridgecrew_enforcement_rule Resource - terraform-provider-bridgecrew" -subcategory: "" -description: |- +layout: "bridgecrew" +page_title: "Bridgecrew: resource_enforcement_rule" +sidebar_current: "docs-bridgecrew-resource_enforcement_rule" +description: |- +Create a new exception rule for a specific set of repositories --- -# bridgecrew_enforcement_rule (Resource) +# bridgecrew_enforcement_rule + +Use this resource to create new exception rules for the Bridgecrew platform . +For more details on this API see their online API documentation . + + + + + +## Example Usage + +Basic usage: + +This tag group creates a disabled tag group attached only to 2 repos, you can source the repo ids from the +repository datasource. + +```hcl + +resource "bridgecrew_enforcement_rule" "imported" { + name = "james2" + description = "first terraform" + isenabled = false + tagruleootbid = "" + + definition { + tag_groups { + name = "1653659061445_key" + tags { + value = { + default = "name" + } + name = "team2" + } + } + } + + repositories = ["00ca7905-d366-470e-9740-3a576fd9b82d","02ecf59e-6cd6-4b14-9c91-816c46211bd2"] +} +``` + +## Importing existing Tagging Policies +You can import existing platform policies into Terraform code. +``` +terraform import bridgecrew_enforcement_rule.imported id +``` +You can view the id, either by using the API docs tag list feature: + or by using the tags datasource. ## Schema diff --git a/scripts/generate-docs.go b/scripts/generate-docs.go index c7cdbac..fe5d68a 100644 --- a/scripts/generate-docs.go +++ b/scripts/generate-docs.go @@ -185,10 +185,10 @@ func main() { name: "resource_tag", path: tempDir + "/resources/tag.md.tmpl", }, - //{ - // name: "resource_enforcement_rule", - // path: tempDir + "/resources/enforcement_rule.md.tmpl", - //}, + { + name: "resource_enforcement_rule", + path: tempDir + "/resources/enforcement_rule.md.tmpl", + }, } var indexPages = []Page{ diff --git a/templates/data-sources/code_reviews.tmpl b/templates/data-sources/code_reviews.md.tmpl similarity index 100% rename from templates/data-sources/code_reviews.tmpl rename to templates/data-sources/code_reviews.md.tmpl diff --git a/templates/data-sources/incidents_info.tmpl b/templates/data-sources/incidents_info.md.tmpl similarity index 100% rename from templates/data-sources/incidents_info.tmpl rename to templates/data-sources/incidents_info.md.tmpl