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

feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources #39180

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Sep 6, 2024

Description

This PR is to add the new aws_synthetics_runtime_version and aws_synthetics_runtime_versions data sources.

Relations

Closes #39165
Closes #39166

References

Referred to DescribeRuntimeVersions for specs.

Output from Acceptance Testing

$ make testacc TESTS="TestAccSyntheticsRuntimeVersionDataSource_|TestAccSyntheticsRuntimeVersionsDataSource_" PKG=synthetics
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsRuntimeVersionDataSource_|TestAccSyntheticsRuntimeVersionsDataSource_'  -timeout 360m
=== RUN   TestAccSyntheticsRuntimeVersionDataSource_basic
=== PAUSE TestAccSyntheticsRuntimeVersionDataSource_basic
=== RUN   TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion
=== PAUSE TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion
=== RUN   TestAccSyntheticsRuntimeVersionsDataSource_basic
=== PAUSE TestAccSyntheticsRuntimeVersionsDataSource_basic
=== RUN   TestAccSyntheticsRuntimeVersionsDataSource_skipDeprecated
=== PAUSE TestAccSyntheticsRuntimeVersionsDataSource_skipDeprecated
=== CONT  TestAccSyntheticsRuntimeVersionDataSource_basic
=== CONT  TestAccSyntheticsRuntimeVersionsDataSource_basic
=== CONT  TestAccSyntheticsRuntimeVersionsDataSource_skipDeprecated
=== CONT  TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion (16.10s)
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_basic (16.12s)
--- PASS: TestAccSyntheticsRuntimeVersionsDataSource_basic (16.20s)
--- PASS: TestAccSyntheticsRuntimeVersionsDataSource_skipDeprecated (19.74s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 20.053s

$

@acwwat acwwat requested a review from a team as a code owner September 6, 2024 04:40
Copy link

github-actions bot commented Sep 6, 2024

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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/synthetics Issues and PRs that pertain to the synthetics service. generators Relates to code generators. needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Sep 6, 2024
@acwwat acwwat force-pushed the f-aws_synthetics_runtime_versions-new_data_source branch 3 times, most recently from 1e7089a to c25c74f Compare September 6, 2024 05:00
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Sep 6, 2024
@acwwat acwwat force-pushed the f-aws_synthetics_runtime_versions-new_data_source branch from c25c74f to 7852bca Compare September 6, 2024 17:03
@acwwat acwwat changed the title feat: Add new aws_synthetics_runtime_verisons data source feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources Sep 6, 2024
@acwwat acwwat force-pushed the f-aws_synthetics_runtime_versions-new_data_source branch from 7852bca to 8d6b9d5 Compare September 6, 2024 17:09
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

Hi @acwwat - Thanks for your submission!

As of 2023-10-20 all net-new data sources are required to use Terraform Plugin Framework. More context is available in this pinned issue and the provider contributor guide.

Maintainers will convert Plugin-SDK based data sources as part of the review process, but if you'd like to do the conversion in the meantime we would greatly appreciate it!

@acwwat
Copy link
Contributor Author

acwwat commented Sep 6, 2024

Hi @acwwat - Thanks for your submission!

As of 2023-10-20 all net-new data sources are required to use Terraform Plugin Framework. More context is available in this pinned issue and the provider contributor guide.

Maintainers will convert Plugin-SDK based data sources as part of the review process, but if you'd like to do the conversion in the meantime we would greatly appreciate it!

OK let me give it a go later. I saw that the rest of the synthetics resources are still using the plugin SDK so I kept to that convention initially.

@acwwat acwwat changed the title feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources [WIP] feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources Sep 6, 2024
@acwwat acwwat force-pushed the f-aws_synthetics_runtime_versions-new_data_source branch from 8d6b9d5 to aaa0654 Compare September 7, 2024 04:59
@acwwat acwwat changed the title [WIP] feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources feat: Add new aws_synthetics_runtime_verison and aws_synthetics_runtime_verisons data sources Sep 7, 2024
@acwwat
Copy link
Contributor Author

acwwat commented Sep 7, 2024

@jar-b I've rewritten the data sources with the Terraform Plugin Framework. Please review, thanks.

There was also a skaff bug #39207 that I encountered and fixed via #39208.

@jar-b jar-b self-assigned this Sep 11, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 11, 2024
```console
% go test -count=1 ./internal/framework/validators/...
ok      github.com/hashicorp/terraform-provider-aws/internal/framework/validators       0.492s
```
…ecated

This change returns a data structure more closely matching the `DescribeRuntimeVersions` API result. It also removes the `skip_deprecated` argument, as the ability to use the `latest` argument on the `aws_synthetics_runtime_version` data source eliminates much of the need to exclude deprecated versions from the result set.

```console
% make testacc PKG=synthetics TESTS=TestAccSyntheticsRuntimeVersion
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsRuntimeVersion'  -timeout 360m

--- PASS: TestAccSyntheticsRuntimeVersionsDataSource_basic (10.21s)
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion (10.21s)
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_basic (10.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 16.489s
```
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% make testacc PKG=synthetics TESTS=TestAccSyntheticsRuntimeVersion
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsRuntimeVersion'  -timeout 360m

--- PASS: TestAccSyntheticsRuntimeVersionsDataSource_basic (10.21s)
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_deprecatedVersion (10.21s)
--- PASS: TestAccSyntheticsRuntimeVersionDataSource_basic (10.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 16.489s

@jar-b
Copy link
Member

jar-b commented Sep 17, 2024

Thanks for your contribution, @acwwat! 👍

This eliminates the dependency on hardcoded runtime versions which become deprecated over time and can cause test failures.

```console
% make testacc PKG=synthetics TESTS=TestAccSyntheticsCanary_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsCanary_'  -timeout 360m

--- PASS: TestAccSyntheticsCanary_tags (94.55s)
--- PASS: TestAccSyntheticsCanary_runtimeVersion (129.64s)
--- PASS: TestAccSyntheticsCanary_runTracing (144.68s)
--- PASS: TestAccSyntheticsCanary_startCanary (194.92s)
--- PASS: TestAccSyntheticsCanary_run (216.00s)
--- PASS: TestAccSyntheticsCanary_runEnvironmentVariables (219.09s)
--- PASS: TestAccSyntheticsCanary_artifactEncryption (237.15s)
--- PASS: TestAccSyntheticsCanary_disappears (470.10s)
--- PASS: TestAccSyntheticsCanary_s3 (559.86s)
--- PASS: TestAccSyntheticsCanary_StartCanary_codeChanges (586.04s)
--- PASS: TestAccSyntheticsCanary_basic (606.08s)
--- PASS: TestAccSyntheticsCanary_rate (678.13s)
--- PASS: TestAccSyntheticsCanary_vpc (2180.95s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 2187.415s
```
@jar-b
Copy link
Member

jar-b commented Sep 18, 2024

Canary resource acceptance tests after migrating to the runtime version data source:

% make testacc PKG=synthetics TESTS=TestAccSyntheticsCanary_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsCanary_'  -timeout 360m

--- PASS: TestAccSyntheticsCanary_tags (94.55s)
--- PASS: TestAccSyntheticsCanary_runtimeVersion (129.64s)
--- PASS: TestAccSyntheticsCanary_runTracing (144.68s)
--- PASS: TestAccSyntheticsCanary_startCanary (194.92s)
--- PASS: TestAccSyntheticsCanary_run (216.00s)
--- PASS: TestAccSyntheticsCanary_runEnvironmentVariables (219.09s)
--- PASS: TestAccSyntheticsCanary_artifactEncryption (237.15s)
--- PASS: TestAccSyntheticsCanary_disappears (470.10s)
--- PASS: TestAccSyntheticsCanary_s3 (559.86s)
--- PASS: TestAccSyntheticsCanary_StartCanary_codeChanges (586.04s)
--- PASS: TestAccSyntheticsCanary_basic (606.08s)
--- PASS: TestAccSyntheticsCanary_rate (678.13s)
--- PASS: TestAccSyntheticsCanary_vpc (2180.95s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 2187.415s

@jar-b jar-b merged commit 9f19ad7 into hashicorp:main Sep 18, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.68.0 milestone Sep 18, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 20, 2024
Copy link

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

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 Oct 22, 2024
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. external-maintainer Contribution from a trusted external contributor. generators Relates to code generators. service/synthetics Issues and PRs that pertain to the synthetics service. 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 Data Source]: aws_synthetics_runtime_version [New Data Source]: aws_synthetics_runtime_versions
2 participants