Skip to content

Panic thrown if Optional or Required not set to true #31211

@independentid

Description

@independentid

Terraform Version

Terraform v1.2.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v4.24.0

Terraform Configuration Files

data "scaffolding_example" "test" {
  configurable_attribute = "example"
}

Debug Output

Expected Behavior

Expecting the modified example data source to work. Modification included an object set with "Required: false" + markdown and type.

Actual Behavior

Panic attack thrown when example_data_source_test.go run

Steps to Reproduce

  1. Instantiate a terraform plugin frameworks template.2.
  2. Modify the example_data_source.go code to add a new attribute test with markdown, type, and required set to false.
  3. Run the test and a panic attack will result4.
  4. Make sure all modifications include either a Required: true or Optional: true and the test will pass.5.

Additional Context

Nothing atypical. Took a while to find the issue.

Note: if you change the name of the provider, the provider_test.go must be updated or none of the tests will pass. This was not obvious in any documentation. Naming is hyper-sensitive to get plugin working. Additional diagnostics would be very helpful.

References

Unknown

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnewnew issue not yet triagedwaiting-responseAn issue/pull request is waiting for a response from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions