hashicorp / hashicorp/terraform-plugin-docs

Import section is now doubly introduced

Open
#552 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
263
Forks
84
Avg merge
3d 6h
Merged PRs (30d)
2

Description

### Terraform CLI and terraform-plugin-docs Versions

```
Terraform v1.14.3
on linux_amd64
```
```
tfplugindocs Version 0.24.0 from commit 954fc54d3f890868d3f9221523ba34134118abcd
```

### Provider Code

```go
func resourceWireguardAsymmetricKeyImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
// d.Id() is the argument passed to terraform import
private_key := d.Id()
key, err := wgtypes.ParseKey(private_key)
if err != nil {
return nil, err
}
d.Set("private_key", key.String())
d.Set("public_key", key.PublicKey().String())
d.SetId(key.PublicKey().String())
return []*schema.ResourceData{d}, nil
}
```

https://github.com/OJFord/terraform-provider-wireguard/blob/b1ee45568c1e4a3d881c347c86140cab6e607728/provider/resource_wireguard_asymmetric_key.go#L74

### Expected Behavior

One introduction for how to import, e.g. previously in v0.21.0:

> ## Import
>
> Import is supported using the following syntax:
>
> ```shell
> terraform import wireguard_asymmetric_key.example "EFr5/97eoK32SeMingmUqJpE4TL21nckcl2jQ9ZT82g="
> ```

(the snippet from `examples/` dir)

### Actual Behavior

Two lines of introduction, two colons:

> ## Import
>
> Import is supported using the following syntax:
>
> The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
>
> ```shell
> terraform import wireguard_asymmetric_key.example "EFr5/97eoK32SeMingmUqJpE4TL21nckcl2jQ9ZT82g="
> ```

### Steps to Reproduce

1. `git clone --single-branch --branch=dependabot/go_modules/github.com/hashicorp/terraform-plugin-docs-0.24.0 https:/github.com/OJFord/terraform-provider-wireguard`
2. `cd terraform-provider-wireguard`
3. `tfplugindocs generate`

### How much impact is this issue causing?

Medium

### Logs

_No response_

### Additional Information

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.