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

fix: Add missing workspace_id from importing aws_grafana_license_association #35290

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Jan 13, 2024

Description

This PR is to add the missing workspace_id attribute (which is the same as id) to imported aws_grafana_license_association resources.

Relations

Closes #34714

References

n/a

Output from Acceptance Testing

While I have updated the test case testAccLicenseAssociation_freeTrial to also test import, I am not able to run it successfully because the underlying AWS API is throwing an error with looking up the marketplace agreement. I am able to reproduce the problem using just AWS CLI.

Either way, here is the output:

$ make testacc TESTS=TestAccGrafana_serial/LicenseAssociation PKG=grafana
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafana_serial/LicenseAssociation'  -timeout 360m
=== RUN   TestAccGrafana_serial
=== PAUSE TestAccGrafana_serial
=== CONT  TestAccGrafana_serial
=== RUN   TestAccGrafana_serial/LicenseAssociation
=== RUN   TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial
    license_association_test.go:27: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating Grafana License Association: ValidationException: Active marketplace agreement not found
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "d7902a10-12bf-428e-b4dd-bb8ee58a2a2e"
          },
          Message_: "Active marketplace agreement not found"
        }
        
          with aws_grafana_license_association.test,
          on terraform_plugin_test.tf line 37, in resource "aws_grafana_license_association" "test":
          37: resource "aws_grafana_license_association" "test" {
        
--- FAIL: TestAccGrafana_serial (308.78s)
    --- FAIL: TestAccGrafana_serial/LicenseAssociation (308.78s)
        --- FAIL: TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial (308.78s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/grafana    309.072s
FAIL
make: *** [GNUmakefile:346: testacc] Error 1
$ 

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 size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/grafana Issues and PRs that pertain to the grafana service. labels Jan 13, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 13, 2024
@acwwat acwwat force-pushed the b-aws_grafana_license_association-set_workspace_id_on_import branch 2 times, most recently from f3dfb4a to 0391fdc Compare January 13, 2024 22:48
@acwwat acwwat changed the title fix: Add missing workspace_id from importing aws_grafana_license_association [WIP] fix: Add missing workspace_id from importing aws_grafana_license_association Jan 13, 2024
@acwwat acwwat force-pushed the b-aws_grafana_license_association-set_workspace_id_on_import branch from 0391fdc to aa799b2 Compare January 13, 2024 22:51
@acwwat acwwat changed the title [WIP] fix: Add missing workspace_id from importing aws_grafana_license_association fix: Add missing workspace_id from importing aws_grafana_license_association Jan 13, 2024
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 16, 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=TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial' PKG=grafana
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20  -run=TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial -timeout 360m
=== RUN   TestAccGrafana_serial
=== PAUSE TestAccGrafana_serial
=== CONT  TestAccGrafana_serial
=== RUN   TestAccGrafana_serial/LicenseAssociation
=== RUN   TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial
--- PASS: TestAccGrafana_serial (821.04s)
    --- PASS: TestAccGrafana_serial/LicenseAssociation (821.04s)
        --- PASS: TestAccGrafana_serial/LicenseAssociation/enterpriseFreeTrial (821.04s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/grafana	831.829s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 3d67697 into hashicorp:main Jan 24, 2024
36 checks passed
@github-actions github-actions bot added this to the v5.34.0 milestone Jan 24, 2024
Copy link

This functionality has been released in v5.34.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 b-aws_grafana_license_association-set_workspace_id_on_import branch January 27, 2024 07:38
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 Feb 27, 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. service/grafana Issues and PRs that pertain to the grafana service. size/XS Managed by automation to categorize the size of a PR. 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.

[Bug]: aws_grafana_license_association does not import workspace ID
3 participants