Skip to content

Resource / Data source examples not detected when a template is provided #9

Closed
@OJFord

Description

@OJFord

The readme describes using resource examples in examples/resources/<name>/resource.tf, but if I template {{ printf "%s" .ExampleFile }} it seems just to be "" for resources.

After a quick look at the code, I think it's just not implemented rather than a bug. I'm sure you know this - a note here just might help anyone else confused by it.

To workaround, you can of course just change the template to remove the if .HasExample and .ExampleFile and replace with a tffile "examples/resources/wherever.tf". That is:

{{/* templates/resources/name.md.tmpl */}}

 ## Example Usage

{{ tffile "examples/resources/name/resource.tf" }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions