Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d/aws_opensearch_serverless_collection: fix autoflex failure #41105

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Jan 27, 2025

Description

The created_date and last_modified_date attributes are string types, while the AWS data structure represents these fields in Unix time as int64 pointers. The mismatch between types resulted in AutoFlex diagnostic errors being printed to stdout, despite the custom handling being present on the Read method to covert Unix time to an RFC3339 formatted string. This change adds an option to ignore these fields during the flatten operation to prevent errant error logs.

2025-01-27T11:41:39.949-0500 [ERROR] aws.autoflex: AutoFlex Flatten; incompatible types: autoflex.source.type="*int64" tf_rpc=ReadDataSource tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=440f6267-4953-4dbb-2934-fc20eece0f95 tf_mux_provider="*proto5server.Server" autoflex.target.path=CreatedDate to=basetypes.StringType from=int64 tf_data_source_type=aws_opensearchserverless_collection autoflex.source.path=CreatedDate autoflex.target.type=github.com/hashicorp/terraform-plugin-framework/types/basetypes.StringValue

Output from Acceptance Testing

% make testacc PKG=opensearchserverless TESTS="TestAccOpenSearchServerlessCollectionDataSource_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/opensearchserverless/... -v -count 1 -parallel 20 -run='TestAccOpenSearchServerlessCollectionDataSource_'  -timeout 360m -vet=off
2025/01/27 13:26:29 Initializing Terraform AWS Provider...

--- PASS: TestAccOpenSearchServerlessCollectionDataSource_name (285.96s)
--- PASS: TestAccOpenSearchServerlessCollectionDataSource_basic (286.01s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless       293.610s

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. generators Relates to code generators. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Jan 27, 2025
@jar-b jar-b force-pushed the b-opensearch_collection-types branch from 4552572 to 270edad Compare January 27, 2025 19:42
@jar-b jar-b marked this pull request as ready for review January 27, 2025 20:54
@jar-b jar-b requested a review from a team as a code owner January 27, 2025 20:54
@jar-b jar-b force-pushed the b-opensearch_collection-types branch 2 times, most recently from 3eba8d3 to 0a7e42f Compare January 28, 2025 18:48
The `created_date` and `last_modified_date` attributes are string types, while the AWS data structure represents these fields in Unix time as `int64` pointers. The mismatch between types resulted in AutoFlex diagnostic errors being printed to stdout, despite the custom handling being present on the Read method to covert Unix time to an RFC3339 formatted string. This change adds an option to ignore these fields during the flatten operation to prevent errant error logs.

```
2025-01-27T11:41:39.949-0500 [ERROR] aws.autoflex: AutoFlex Flatten; incompatible types: autoflex.source.type="*int64" tf_rpc=ReadDataSource tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=440f6267-4953-4dbb-2934-fc20eece0f95 tf_mux_provider="*proto5server.Server" autoflex.target.path=CreatedDate to=basetypes.StringType from=int64 tf_data_source_type=aws_opensearchserverless_collection autoflex.source.path=CreatedDate autoflex.target.type=github.com/hashicorp/terraform-plugin-framework/types/basetypes.StringValue
```

```console
% make testacc PKG=opensearchserverless TESTS="TestAccOpenSearchServerlessCollectionDataSource_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/opensearchserverless/... -v -count 1 -parallel 20 -run='TestAccOpenSearchServerlessCollectionDataSource_'  -timeout 360m -vet=off
2025/01/27 13:26:29 Initializing Terraform AWS Provider...

--- PASS: TestAccOpenSearchServerlessCollectionDataSource_name (285.96s)
--- PASS: TestAccOpenSearchServerlessCollectionDataSource_basic (286.01s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/opensearchserverless       293.610s
```
@jar-b jar-b force-pushed the b-opensearch_collection-types branch from 0a7e42f to ae0283b Compare January 28, 2025 18:49
Copy link
Contributor

@johnsonaj johnsonaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jar-b jar-b merged commit e893303 into main Jan 28, 2025
47 checks passed
@jar-b jar-b deleted the b-opensearch_collection-types branch January 28, 2025 19:53
@github-actions github-actions bot added this to the v5.85.0 milestone Jan 28, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request Jan 28, 2025
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 3, 2025
Copy link

github-actions bot commented Feb 3, 2025

This functionality has been released in v5.85.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants