hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.82k stars 9.17k forks source link

[Bug]: skaff datasource fails with "can't evaluate field Resource in type datasource.TemplateData" error #39207

Closed acwwat closed 1 month ago

acwwat commented 1 month ago

Terraform Core Version

1.6.6

AWS Provider Version

5.66.0

Affected Resource(s)

No response

Expected Behavior

skaff generates the data source artifacts successfully.

Actual Behavior

skaff fails with the error below and the generated files (data source code, data source test code, documentation) are all empty.

Relevant Error/Panic Output Snippet

$ skaff datasource -f -n RuntimeVersion
Error: writing datasource template: error executing template: template: newds:204:64: executing "newds" at <.Resource>: can't evaluate field Resource in type datasource.TemplateData
Usage:
  skaff datasource [flags]

Flags:
  -c, --clear-comments     do not include instructional comments in source
  -f, --force              force creation, overwriting existing files
  -h, --help               help for datasource
  -t, --include-tags       Indicate that this resource has tags and the code for tagging should be generated
  -n, --name string        name of the entity
  -p, --plugin-sdkv2       generate for Terraform Plugin SDK V2
  -s, --snakename string   if skaff doesn't get it right, explicitly give name in snake case (e.g., db_vpc_instance)
  -o, --v1                 generate for AWS Go SDK v1 (some existing services)

$

Terraform Configuration Files

n/a

Steps to Reproduce

  1. cd to a service directory (e.g., internal/service/synthetics).
  2. Run the skaff command (e.g., skaff datasource -f -n RuntimeVersion).

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 month ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 1 month ago

This functionality has been released in v5.67.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 3 weeks ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.