mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
feat: ignore outputs, providers, resources with comments
Prepend any type of resource, including `resource`, `data`, `module`, `variable`, and `output` with a comment including "terraform-docs-ignore" to exclude it from the generated output. Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
@@ -63,8 +63,20 @@ data "aws_caller_identity" "ident" {
|
||||
provider = "aws.ident"
|
||||
}
|
||||
|
||||
# terraform-docs-ignore
|
||||
data "aws_caller_identity" "ignored" {
|
||||
provider = "aws"
|
||||
}
|
||||
|
||||
resource "null_resource" "foo" {}
|
||||
|
||||
# This resource is going to get ignored from generated
|
||||
# output by using the following known comment.
|
||||
# terraform-docs-ignore
|
||||
# And the ignore keyword also doesn't have to be the first,
|
||||
# last, or only thing in a leading comment
|
||||
resource "null_resource" "ignored" {}
|
||||
|
||||
module "bar" {
|
||||
source = "baz"
|
||||
version = "4.5.6"
|
||||
@@ -84,3 +96,9 @@ module "baz" {
|
||||
module "foobar" {
|
||||
source = "git@github.com:module/path?ref=v7.8.9"
|
||||
}
|
||||
|
||||
// terraform-docs-ignore
|
||||
module "ignored" {
|
||||
source = "foobaz"
|
||||
version = "7.8.9"
|
||||
}
|
||||
|
||||
@@ -17,3 +17,8 @@ output "output-0.12" {
|
||||
value = join(",", var.list-3)
|
||||
description = "terraform 0.12 only"
|
||||
}
|
||||
|
||||
// terraform-docs-ignore
|
||||
output "ignored" {
|
||||
value = "ignored"
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ variable "bool-1" {
|
||||
default = true
|
||||
}
|
||||
|
||||
# terraform-docs-ignore
|
||||
variable "ignored" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "string-3" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user