Giter VIP home page Giter VIP logo

Comments (6)

cytopia avatar cytopia commented on July 18, 2024 1

I've just played around a little and got a few bugs fixed, but it seems to be more complicated as expected and one must also take into account comments, as well as brackets within strings. I keep you posted on the progress.

from pre-commit-terraform.

cytopia avatar cytopia commented on July 18, 2024

Is this the affecting line: https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/variables.tf#L26 ?

from pre-commit-terraform.

antonbabenko avatar antonbabenko commented on July 18, 2024

I don't think so, but I also can't identify exactly which line makes the problem.

Here is the beginning of produced tf-file after awk script:

  description = var.description
  description = var.description
  description      = var.rules[var.ingress_rules[count.index]][3]
  description      = var.rules[var.computed_ingress_rules[count.index]][3]
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description      = var.rules[var.egress_rules[count.index]][3]
  description      = var.rules[var.computed_egress_rules[count.index]][3]
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
  description = lookup(
output "this_security_group_id" {
  description = "The ID of the security group"
}
output "this_security_group_vpc_id" {
  description = "The VPC ID"
}
output "this_security_group_owner_id" {
  description = "The owner ID"
}
output "this_security_group_name" {
  description = "The name of the security group"
}
output "this_security_group_description" {
  description = "The description of the security group"
}
//output "this_security_group_ingress" {
//}
//output "this_security_group_egress" {
variable "rules" {
  description = "Map of known security group rules (define as 'name' = ['from port', 'to port', 'protocol', 'description'])"
  type = "map(list(any))"
...................

from pre-commit-terraform.

cytopia avatar cytopia commented on July 18, 2024

@antonbabenko I've added another version here: cytopia/docker-terraform-docs#13

I will still need to add all discovered edge cases in the test directory, so I can ensure this is stable for the currently discovered issues. Once it plays well, I'll update the PR at: cloudposse/build-harness#155

Feel free to copy the file over and see how it works in your projects

from pre-commit-terraform.

cytopia avatar cytopia commented on July 18, 2024

Update

I've tested main module, all sub-modules as well as all examples in https://github.com/terraform-aws-modules/terraform-aws-security-group/ very quickly via:

d=$(pwd); for i in $(/bin/ls); do if test -d $d/$i; then cd $d/$i; if ! docker run --rm -v $(pwd):/data cytopia/terraform-docs terraform-docs-012 md .;then exit 1;fi ; else echo $d/$i; fi  done

Everything generates without any errors.

I am not sure what arguments you add to terraform-docs, so you should probably test it via the pre-commit-terraform project and ensure no changes are present after the generation.

from pre-commit-terraform.

antonbabenko avatar antonbabenko commented on July 18, 2024

v1.15.0 has been released with the fix.

from pre-commit-terraform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.