Skip to content

Import section is now doubly introduced #552

@OJFord

Description

@OJFord

Terraform CLI and terraform-plugin-docs Versions

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

Provider Code

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:

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 can be used, for example:

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

  • I agree to follow this project's Code of Conduct

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