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: Mark name arg as optional to match AWS API for aws_ram_resource_share data source #36062

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Mar 4, 2024

Description

This PR is to set the name argument to optional for the aws_ram_resource_share data source, so that it matches the AWS API spec.

Relations

Closes #33153.
Closes #33483.
Closes #36070.
Closes #35296.

References

Referred to GetResourceShares in API reference to confirm specs and behavior.

Output from Acceptance Testing

$ make testacc TESTARGS="-run=TestAccRAMResourceShareDataSource_" PKG=ram
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ram/... -v -count 1 -parallel 20  -run=TestAccRAMResourceShareDataSource_ -timeout 360m
=== RUN   TestAccRAMResourceShareDataSource_basic
=== PAUSE TestAccRAMResourceShareDataSource_basic
=== RUN   TestAccRAMResourceShareDataSource_tags
=== PAUSE TestAccRAMResourceShareDataSource_tags
=== RUN   TestAccRAMResourceShareDataSource_resources
=== PAUSE TestAccRAMResourceShareDataSource_resources
=== RUN   TestAccRAMResourceShareDataSource_status
=== PAUSE TestAccRAMResourceShareDataSource_status
=== CONT  TestAccRAMResourceShareDataSource_basic
=== CONT  TestAccRAMResourceShareDataSource_resources
=== CONT  TestAccRAMResourceShareDataSource_tags
=== CONT  TestAccRAMResourceShareDataSource_status
--- PASS: TestAccRAMResourceShareDataSource_status (62.28s)
--- PASS: TestAccRAMResourceShareDataSource_basic (74.17s)
--- PASS: TestAccRAMResourceShareDataSource_tags (84.13s)
--- PASS: TestAccRAMResourceShareDataSource_resources (142.50s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ram        142.659s

$

Copy link

github-actions bot commented Mar 4, 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 size/S Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ram Issues and PRs that pertain to the ram service. labels Mar 4, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 4, 2024
@acwwat acwwat force-pushed the f-aws_ram_resource_share-data_source_name_optional branch from b7e7f76 to 39b240b Compare March 4, 2024 03:39
@acwwat acwwat changed the title [WIP] feat: Mark name arg as optional to match AWS API for aws_ram_resource_share data source feat: Mark name arg as optional to match AWS API for aws_ram_resource_share data source Mar 4, 2024
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 7, 2024
% make testacc TESTARGS='-run=TestAccRAMResourceShareDataSource_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceShareDataSource_ -timeout 360m
=== RUN   TestAccRAMResourceShareDataSource_basic
=== PAUSE TestAccRAMResourceShareDataSource_basic
=== RUN   TestAccRAMResourceShareDataSource_tags
=== PAUSE TestAccRAMResourceShareDataSource_tags
=== RUN   TestAccRAMResourceShareDataSource_resources
=== PAUSE TestAccRAMResourceShareDataSource_resources
=== RUN   TestAccRAMResourceShareDataSource_status
=== PAUSE TestAccRAMResourceShareDataSource_status
=== CONT  TestAccRAMResourceShareDataSource_basic
=== CONT  TestAccRAMResourceShareDataSource_resources
--- PASS: TestAccRAMResourceShareDataSource_basic (22.08s)
=== CONT  TestAccRAMResourceShareDataSource_status
--- PASS: TestAccRAMResourceShareDataSource_resources (31.19s)
=== CONT  TestAccRAMResourceShareDataSource_tags
--- PASS: TestAccRAMResourceShareDataSource_status (20.36s)
--- PASS: TestAccRAMResourceShareDataSource_tags (33.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	71.779s
% make testacc TESTARGS='-run=TestAccRAMSharingWithOrganization_serial' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMSharingWithOrganization_serial -timeout 360m
=== RUN   TestAccRAMSharingWithOrganization_serial
=== PAUSE TestAccRAMSharingWithOrganization_serial
=== CONT  TestAccRAMSharingWithOrganization_serial
=== RUN   TestAccRAMSharingWithOrganization_serial/basic
=== RUN   TestAccRAMSharingWithOrganization_serial/disappears
--- PASS: TestAccRAMSharingWithOrganization_serial (62.85s)
    --- PASS: TestAccRAMSharingWithOrganization_serial/basic (33.02s)
    --- PASS: TestAccRAMSharingWithOrganization_serial/disappears (29.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	69.848s
% make testacc TESTARGS='-run=TestAccRAMPrincipalAssociation_duplicate' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMPrincipalAssociation_duplicate -timeout 360m
=== RUN   TestAccRAMPrincipalAssociation_duplicate
=== PAUSE TestAccRAMPrincipalAssociation_duplicate
=== CONT  TestAccRAMPrincipalAssociation_duplicate
--- PASS: TestAccRAMPrincipalAssociation_duplicate (28.71s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	35.841s
% make testacc TESTARGS='-run=TestAccRAMResourceAssociation_duplicate' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceAssociation_duplicate -timeout 360m
=== RUN   TestAccRAMResourceAssociation_duplicate
=== PAUSE TestAccRAMResourceAssociation_duplicate
=== CONT  TestAccRAMResourceAssociation_duplicate
--- PASS: TestAccRAMResourceAssociation_duplicate (27.12s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	34.588s
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Mar 14, 2024
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. generators Relates to code generators. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) and removed size/S Managed by automation to categorize the size of a PR. labels Mar 14, 2024
Copy link
Contributor

@ewbankkit ewbankkit 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 TESTARGS='-run=TestAccRAMResourceShareDataSource_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceShareDataSource_ -timeout 360m
=== RUN   TestAccRAMResourceShareDataSource_basic
=== PAUSE TestAccRAMResourceShareDataSource_basic
=== RUN   TestAccRAMResourceShareDataSource_tags
=== PAUSE TestAccRAMResourceShareDataSource_tags
=== RUN   TestAccRAMResourceShareDataSource_resources
=== PAUSE TestAccRAMResourceShareDataSource_resources
=== RUN   TestAccRAMResourceShareDataSource_status
=== PAUSE TestAccRAMResourceShareDataSource_status
=== CONT  TestAccRAMResourceShareDataSource_basic
=== CONT  TestAccRAMResourceShareDataSource_resources
--- PASS: TestAccRAMResourceShareDataSource_basic (22.08s)
=== CONT  TestAccRAMResourceShareDataSource_status
--- PASS: TestAccRAMResourceShareDataSource_resources (31.19s)
=== CONT  TestAccRAMResourceShareDataSource_tags
--- PASS: TestAccRAMResourceShareDataSource_status (20.36s)
--- PASS: TestAccRAMResourceShareDataSource_tags (33.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	71.779s
% make testacc TESTARGS='-run=TestAccRAMResourceShare_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceShare_ -timeout 360m
=== RUN   TestAccRAMResourceShare_basic
=== PAUSE TestAccRAMResourceShare_basic
=== RUN   TestAccRAMResourceShare_permission
=== PAUSE TestAccRAMResourceShare_permission
=== RUN   TestAccRAMResourceShare_allowExternalPrincipals
=== PAUSE TestAccRAMResourceShare_allowExternalPrincipals
=== RUN   TestAccRAMResourceShare_name
=== PAUSE TestAccRAMResourceShare_name
=== RUN   TestAccRAMResourceShare_tags
=== PAUSE TestAccRAMResourceShare_tags
=== RUN   TestAccRAMResourceShare_disappears
=== PAUSE TestAccRAMResourceShare_disappears
=== CONT  TestAccRAMResourceShare_basic
=== CONT  TestAccRAMResourceShare_name
--- PASS: TestAccRAMResourceShare_basic (23.95s)
=== CONT  TestAccRAMResourceShare_allowExternalPrincipals
--- PASS: TestAccRAMResourceShare_name (37.23s)
=== CONT  TestAccRAMResourceShare_disappears
--- PASS: TestAccRAMResourceShare_disappears (20.75s)
=== CONT  TestAccRAMResourceShare_tags
--- PASS: TestAccRAMResourceShare_allowExternalPrincipals (36.64s)
=== CONT  TestAccRAMResourceShare_permission
--- PASS: TestAccRAMResourceShare_permission (22.81s)
--- PASS: TestAccRAMResourceShare_tags (48.71s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	113.847s
% make testacc TESTARGS='-run=TestAccRAMSharingWithOrganization_serial' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMSharingWithOrganization_serial -timeout 360m
=== RUN   TestAccRAMSharingWithOrganization_serial
=== PAUSE TestAccRAMSharingWithOrganization_serial
=== CONT  TestAccRAMSharingWithOrganization_serial
=== RUN   TestAccRAMSharingWithOrganization_serial/basic
=== RUN   TestAccRAMSharingWithOrganization_serial/disappears
--- PASS: TestAccRAMSharingWithOrganization_serial (62.85s)
    --- PASS: TestAccRAMSharingWithOrganization_serial/basic (33.02s)
    --- PASS: TestAccRAMSharingWithOrganization_serial/disappears (29.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	69.848s
% make testacc TESTARGS='-run=TestAccRAMResourceShareAccepter_' PKG=ram ACCTEST_PARALLELISM=2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceShareAccepter_ -timeout 360m
=== RUN   TestAccRAMResourceShareAccepter_basic
=== PAUSE TestAccRAMResourceShareAccepter_basic
=== RUN   TestAccRAMResourceShareAccepter_disappears
=== PAUSE TestAccRAMResourceShareAccepter_disappears
=== RUN   TestAccRAMResourceShareAccepter_resourceAssociation
=== PAUSE TestAccRAMResourceShareAccepter_resourceAssociation
=== CONT  TestAccRAMResourceShareAccepter_basic
=== CONT  TestAccRAMResourceShareAccepter_resourceAssociation
--- PASS: TestAccRAMResourceShareAccepter_basic (40.32s)
=== CONT  TestAccRAMResourceShareAccepter_disappears
--- PASS: TestAccRAMResourceShareAccepter_resourceAssociation (42.29s)
--- PASS: TestAccRAMResourceShareAccepter_disappears (151.63s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	198.903s
% make testacc TESTARGS='-run=TestAccRAMResourceAssociation_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMResourceAssociation_ -timeout 360m
=== RUN   TestAccRAMResourceAssociation_basic
=== PAUSE TestAccRAMResourceAssociation_basic
=== RUN   TestAccRAMResourceAssociation_disappears
=== PAUSE TestAccRAMResourceAssociation_disappears
=== RUN   TestAccRAMResourceAssociation_duplicate
=== PAUSE TestAccRAMResourceAssociation_duplicate
=== CONT  TestAccRAMResourceAssociation_basic
=== CONT  TestAccRAMResourceAssociation_duplicate
--- PASS: TestAccRAMResourceAssociation_duplicate (18.07s)
=== CONT  TestAccRAMResourceAssociation_disappears
--- PASS: TestAccRAMResourceAssociation_basic (31.49s)
--- PASS: TestAccRAMResourceAssociation_disappears (27.48s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	53.148s
% make testacc TESTARGS='-run=TestAccRAMPrincipalAssociation_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMPrincipalAssociation_ -timeout 360m
=== RUN   TestAccRAMPrincipalAssociation_basic
=== PAUSE TestAccRAMPrincipalAssociation_basic
=== RUN   TestAccRAMPrincipalAssociation_AccountID
=== PAUSE TestAccRAMPrincipalAssociation_AccountID
=== RUN   TestAccRAMPrincipalAssociation_disappears
=== PAUSE TestAccRAMPrincipalAssociation_disappears
=== CONT  TestAccRAMPrincipalAssociation_basic
=== CONT  TestAccRAMPrincipalAssociation_disappears
--- PASS: TestAccRAMPrincipalAssociation_disappears (23.80s)
=== CONT  TestAccRAMPrincipalAssociation_AccountID
    principal_association_test.go:58: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRAMPrincipalAssociation_AccountID (0.00s)
--- PASS: TestAccRAMPrincipalAssociation_basic (26.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	33.299s
% make testacc TESTARGS='-run=TestAccRAMPrincipalAssociation_' PKG=ram ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/ram/... -v -count 1 -parallel 2  -run=TestAccRAMPrincipalAssociation_ -timeout 360m
=== RUN   TestAccRAMPrincipalAssociation_basic
=== PAUSE TestAccRAMPrincipalAssociation_basic
=== RUN   TestAccRAMPrincipalAssociation_AccountID
=== PAUSE TestAccRAMPrincipalAssociation_AccountID
=== RUN   TestAccRAMPrincipalAssociation_disappears
=== PAUSE TestAccRAMPrincipalAssociation_disappears
=== CONT  TestAccRAMPrincipalAssociation_basic
=== CONT  TestAccRAMPrincipalAssociation_disappears
=== NAME  TestAccRAMPrincipalAssociation_basic
    principal_association_test.go:117: Sharing with AWS Organization not found, skipping acceptance test: reading IAM Role (AWSServiceRoleForResourceAccessManager): couldn't find resource
--- SKIP: TestAccRAMPrincipalAssociation_basic (1.57s)
=== CONT  TestAccRAMPrincipalAssociation_AccountID
=== NAME  TestAccRAMPrincipalAssociation_disappears
    principal_association_test.go:117: Sharing with AWS Organization not found, skipping acceptance test: reading IAM Role (AWSServiceRoleForResourceAccessManager): couldn't find resource
--- SKIP: TestAccRAMPrincipalAssociation_disappears (1.58s)
--- PASS: TestAccRAMPrincipalAssociation_AccountID (30.37s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ram	38.839s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 9623cda into hashicorp:main Mar 14, 2024
30 checks passed
@github-actions github-actions bot added this to the v5.41.0 milestone Mar 14, 2024
Copy link

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

@acwwat acwwat deleted the f-aws_ram_resource_share-data_source_name_optional branch March 22, 2024 06:06
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 Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. generators Relates to code generators. service/ram Issues and PRs that pertain to the ram 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. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.)
Projects
None yet
3 participants