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

PoC: Initial generic Plugin Framework flattener/expander functions #31858

Merged
merged 79 commits into from
Jun 23, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 8, 2023

Description

Very preliminary thoughts around generic Terraform Plugin Framework "flattener/expander"s.
The new functions in internal/framework/flex are a PoC and should be considered experimental.

Introduces the concept of "auto-flex", run-time reflection powered flatteners and expanders between Terraform Plugin Framework-compatible Go structures and AWS SDK for Go (v1 and v2) Go structures.
Currently only working for primitive types.

Relations

Closes #32105.
Closes #32011.

Requires hashicorp/aws-sdk-go-base#524.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccEC2InstanceConnectEndpoint_' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2  -run=TestAccEC2InstanceConnectEndpoint_ -timeout 180m
=== RUN   TestAccEC2InstanceConnectEndpoint_basic
=== PAUSE TestAccEC2InstanceConnectEndpoint_basic
=== RUN   TestAccEC2InstanceConnectEndpoint_disappears
=== PAUSE TestAccEC2InstanceConnectEndpoint_disappears
=== RUN   TestAccEC2InstanceConnectEndpoint_tags
=== PAUSE TestAccEC2InstanceConnectEndpoint_tags
=== RUN   TestAccEC2InstanceConnectEndpoint_securityGroupIDs
=== PAUSE TestAccEC2InstanceConnectEndpoint_securityGroupIDs
=== CONT  TestAccEC2InstanceConnectEndpoint_basic
=== CONT  TestAccEC2InstanceConnectEndpoint_tags
--- PASS: TestAccEC2InstanceConnectEndpoint_basic (239.44s)
=== CONT  TestAccEC2InstanceConnectEndpoint_disappears
--- PASS: TestAccEC2InstanceConnectEndpoint_disappears (239.99s)
=== CONT  TestAccEC2InstanceConnectEndpoint_securityGroupIDs
--- PASS: TestAccEC2InstanceConnectEndpoint_tags (705.94s)
--- PASS: TestAccEC2InstanceConnectEndpoint_securityGroupIDs (237.27s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	722.577s
% make testacc TESTARGS='-run=TestAccResourceExplorer2_serial' PKG=resourceexplorer2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/resourceexplorer2/... -v -count 1 -parallel 20  -run=TestAccResourceExplorer2_serial -timeout 180m
=== RUN   TestAccResourceExplorer2_serial
=== PAUSE TestAccResourceExplorer2_serial
=== CONT  TestAccResourceExplorer2_serial
=== RUN   TestAccResourceExplorer2_serial/Index
=== RUN   TestAccResourceExplorer2_serial/Index/tags
=== RUN   TestAccResourceExplorer2_serial/Index/type
=== RUN   TestAccResourceExplorer2_serial/Index/basic
=== RUN   TestAccResourceExplorer2_serial/Index/disappears
=== RUN   TestAccResourceExplorer2_serial/View
=== RUN   TestAccResourceExplorer2_serial/View/basic
=== RUN   TestAccResourceExplorer2_serial/View/defaultView
=== RUN   TestAccResourceExplorer2_serial/View/disappears
=== RUN   TestAccResourceExplorer2_serial/View/filter
=== RUN   TestAccResourceExplorer2_serial/View/tags
--- PASS: TestAccResourceExplorer2_serial (355.57s)
    --- PASS: TestAccResourceExplorer2_serial/Index (155.17s)
        --- PASS: TestAccResourceExplorer2_serial/Index/tags (67.08s)
        --- PASS: TestAccResourceExplorer2_serial/Index/type (42.44s)
        --- PASS: TestAccResourceExplorer2_serial/Index/basic (26.38s)
        --- PASS: TestAccResourceExplorer2_serial/Index/disappears (19.26s)
    --- PASS: TestAccResourceExplorer2_serial/View (200.39s)
        --- PASS: TestAccResourceExplorer2_serial/View/basic (26.06s)
        --- PASS: TestAccResourceExplorer2_serial/View/defaultView (57.02s)
        --- PASS: TestAccResourceExplorer2_serial/View/disappears (22.57s)
        --- PASS: TestAccResourceExplorer2_serial/View/filter (39.86s)
        --- PASS: TestAccResourceExplorer2_serial/View/tags (54.89s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2	361.500s

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

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 size/L Managed by automation to categorize the size of a PR. flex Pertains to FLatteners and EXpanders. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 8, 2023
@ewbankkit ewbankkit changed the title Initial generic Plugin Framework flattener/expander functions [WIP] Initial generic Plugin Framework flattener/expander functions Jun 8, 2023
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Jun 9, 2023
# Conflicts:
#	internal/service/resourceexplorer2/view.go
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Jun 16, 2023
@github-actions github-actions bot added service/appconfig Issues and PRs that pertain to the appconfig service. service/cognitoidp Issues and PRs that pertain to the cognitoidp service. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. sweeper Pertains to changes to or issues with the sweeper. and removed flex Pertains to FLatteners and EXpanders. labels Jun 21, 2023
@ewbankkit ewbankkit added the new-resource Introduces a new resource. label Jun 21, 2023
Acceptance test output:

% make testacc TESTARGS='-run=TestAccResourceExplorer2_serial/Index/basic' PKG=resourceexplorer2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/resourceexplorer2/... -v -count 1 -parallel 20  -run=TestAccResourceExplorer2_serial/Index/basic -timeout 180m
=== RUN   TestAccResourceExplorer2_serial
=== PAUSE TestAccResourceExplorer2_serial
=== CONT  TestAccResourceExplorer2_serial
=== RUN   TestAccResourceExplorer2_serial/Index
=== RUN   TestAccResourceExplorer2_serial/Index/basic
--- PASS: TestAccResourceExplorer2_serial (26.46s)
    --- PASS: TestAccResourceExplorer2_serial/Index (26.46s)
        --- PASS: TestAccResourceExplorer2_serial/Index/basic (26.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2	32.079s
…hub.com/hashicorp/aws-sdk-go-base/v2@1c3bdec608c2d79d34f43ad2f4bfd618002ffaca && go mod tidy'.
@ewbankkit ewbankkit changed the title [WIP] Initial generic Plugin Framework flattener/expander functions PoC: Initial generic Plugin Framework flattener/expander functions Jun 22, 2023
@ewbankkit ewbankkit added the flex Pertains to FLatteners and EXpanders. label Jun 22, 2023
…e/v2=github.com/hashicorp/aws-sdk-go-base/v2@1c3bdec608c2d79d34f43ad2f4bfd618002ffaca && go mod tidy'."

This reverts commit 162f688.
@github-actions github-actions bot removed the flex Pertains to FLatteners and EXpanders. label Jun 23, 2023
@ewbankkit ewbankkit merged commit d57f816 into main Jun 23, 2023
@ewbankkit ewbankkit deleted the td-framework-flex branch June 23, 2023 14:31
@github-actions github-actions bot added this to the v5.6.0 milestone Jun 23, 2023
github-actions bot pushed a commit that referenced this pull request Jun 23, 2023
@virgofx
Copy link

virgofx commented Jun 23, 2023

Any chance we can release 5.6.0 to utilize aws_ec2_instance_connect_endpoint ?

@ewbankkit
Copy link
Contributor Author

@virgofx The release is scheduled for Thursday.

@github-actions
Copy link

This functionality has been released in v5.6.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
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. service/appconfig Issues and PRs that pertain to the appconfig service. service/cognitoidp Issues and PRs that pertain to the cognitoidp service. service/ec2 Issues and PRs that pertain to the ec2 service. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Resource]: aws_ec2_instance_connect_endpoint
3 participants