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

New Resources: aws_licensemanager_grant and aws_licensemanager_grant_accepter, New Datasources: aws_licensemanager_received_license , aws_licensemanager_received_licenses, and aws_licensemanager_grants #29741

Merged
merged 61 commits into from
Mar 9, 2023

Conversation

brittandeyoung
Copy link
Collaborator

@brittandeyoung brittandeyoung commented Mar 1, 2023

Description

This PR adds a new resource to allow managing aws_licensemanager_grant and aws_licensemanager_grant_accepter within terraform. In the raised issue, the initial thought was to have aws_licensemanager_grant and aws_licensemanager_grant_version be separate resources. In reviewing the API, the CreateGrantVersion seamed to have the behavior of updating an existing grant, because of this I feel it would be better handled all in one resource. Would love feedback on if this is a good direction, or not.

The PR also implements the following two new datasource: aws_licensemanager_received_license, aws_licensemanager_received_licenses, and aws_licensemanager_grants for getting data on licenses from the AWS market place.

As this requires multiple accounts to test, three environment variables must be set in order to run the acceptance tests.

Relations

Closes #17146

References

Output from Acceptance Testing

$ make testacc TESTARGS='-run=LicenseManagerGrant' PKG=licensemanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/licensemanager/... -v -count 1 -parallel 20  -run=LicenseManagerGrant -timeout 180m
=== RUN   TestAccLicenseManagerGrant_serial
=== PAUSE TestAccLicenseManagerGrant_serial
=== CONT  TestAccLicenseManagerGrant_serial
=== RUN   TestAccLicenseManagerGrant_serial/grant
=== RUN   TestAccLicenseManagerGrant_serial/grant/basic
=== RUN   TestAccLicenseManagerGrant_serial/grant/disappears
=== RUN   TestAccLicenseManagerGrant_serial/grant/name
--- PASS: TestAccLicenseManagerGrant_serial (51.24s)
    --- PASS: TestAccLicenseManagerGrant_serial/grant (51.24s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/basic (17.00s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/disappears (10.32s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/name (23.92s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager     55.377s

$ make testacc TESTARGS='-run=LicenseManagerGrantAccepter' PKG=licensemanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/licensemanager/... -v -count 1 -parallel 20  -run=LicenseManagerGrantAccepter -timeout 180m
=== RUN   TestAccLicenseManagerGrantAccepter_serial
=== PAUSE TestAccLicenseManagerGrantAccepter_serial
=== CONT  TestAccLicenseManagerGrantAccepter_serial
=== RUN   TestAccLicenseManagerGrantAccepter_serial/grant
=== RUN   TestAccLicenseManagerGrantAccepter_serial/grant/basic
=== RUN   TestAccLicenseManagerGrantAccepter_serial/grant/disappears
--- PASS: TestAccLicenseManagerGrantAccepter_serial (40.94s)
    --- PASS: TestAccLicenseManagerGrantAccepter_serial/grant (40.94s)
        --- PASS: TestAccLicenseManagerGrantAccepter_serial/grant/basic (23.45s)
        --- PASS: TestAccLicenseManagerGrantAccepter_serial/grant/disappears (17.48s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager     44.076s

make testacc TESTARGS='-run=LicenseManagerReceivedLicensesDataSource' PKG=licensemanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/licensemanager/... -v -count 1 -parallel 20  -run=LicenseManagerReceivedLicensesDataSource -timeout 180m
=== RUN   TestAccLicenseManagerReceivedLicensesDataSource_basic
=== PAUSE TestAccLicenseManagerReceivedLicensesDataSource_basic
=== RUN   TestAccLicenseManagerReceivedLicensesDataSource_empty
=== PAUSE TestAccLicenseManagerReceivedLicensesDataSource_empty
=== CONT  TestAccLicenseManagerReceivedLicensesDataSource_basic
=== CONT  TestAccLicenseManagerReceivedLicensesDataSource_empty
--- PASS: TestAccLicenseManagerReceivedLicensesDataSource_basic (10.44s)
--- PASS: TestAccLicenseManagerReceivedLicensesDataSource_empty (10.81s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager     15.093s

make testacc TESTARGS='-run=LicenseManagerReceivedLicenseData' PKG=licensemanager                                    
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/licensemanager/... -v -count 1 -parallel 20  -run=LicenseManagerReceivedLicenseData -timeout 180m
=== RUN   TestAccLicenseManagerReceivedLicenseDataSource_basic
=== PAUSE TestAccLicenseManagerReceivedLicenseDataSource_basic
=== CONT  TestAccLicenseManagerReceivedLicenseDataSource_basic
--- PASS: TestAccLicenseManagerReceivedLicenseDataSource_basic (14.50s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager     17.538s

✗ make testacc TESTARGS='-run=LicenseManagerGrantsData' PKG=licensemanager
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/licensemanager/... -v -count 1 -parallel 20  -run=LicenseManagerGrantsData -timeout 180m
=== RUN   TestAccLicenseManagerGrantsDataSource_serial
=== PAUSE TestAccLicenseManagerGrantsDataSource_serial
=== CONT  TestAccLicenseManagerGrantsDataSource_serial
=== RUN   TestAccLicenseManagerGrantsDataSource_serial/grant
=== RUN   TestAccLicenseManagerGrantsDataSource_serial/grant/basic
=== RUN   TestAccLicenseManagerGrantsDataSource_serial/grant/empty
--- PASS: TestAccLicenseManagerGrantsDataSource_serial (28.78s)
    --- PASS: TestAccLicenseManagerGrantsDataSource_serial/grant (28.78s)
        --- PASS: TestAccLicenseManagerGrantsDataSource_serial/grant/basic (18.14s)
        --- PASS: TestAccLicenseManagerGrantsDataSource_serial/grant/empty (10.64s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager     33.509s
...


@github-actions
Copy link

github-actions bot commented Mar 1, 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 documentation Introduces or discusses updates to documentation. generators Relates to code generators. service/licensemanager Issues and PRs that pertain to the licensemanager service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. labels Mar 1, 2023
@brittandeyoung brittandeyoung added the new-resource Introduces a new resource. label Mar 1, 2023
@brittandeyoung brittandeyoung changed the title New Resource: aws_licensemanager_grant New Resource: aws_licensemanager_grant and aws_licensemanager_grant_accepter Mar 1, 2023
@gdavison gdavison self-assigned this Mar 3, 2023
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @brittandeyoung. I have a few comments on the work so far

internal/service/licensemanager/grant.go Outdated Show resolved Hide resolved
internal/service/licensemanager/grant.go Show resolved Hide resolved
internal/service/licensemanager/grant.go Outdated Show resolved Hide resolved
internal/service/licensemanager/grant.go Outdated Show resolved Hide resolved
internal/service/licensemanager/grant_test.go Outdated Show resolved Hide resolved
website/docs/r/licensemanager_grant.html.markdown Outdated Show resolved Hide resolved
internal/service/licensemanager/grant_accepter_test.go Outdated Show resolved Hide resolved
@brittandeyoung brittandeyoung changed the title New Resources: aws_licensemanager_grant and aws_licensemanager_grant_accepter, New Datasources: aws_licensemanager_received_license , aws_licensemanager_received_licenses, and aws_licensemanager_grants` New Resources: aws_licensemanager_grant and aws_licensemanager_grant_accepter, New Datasources: aws_licensemanager_received_license , aws_licensemanager_received_licenses, and aws_licensemanager_grants Mar 8, 2023
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this, @brittandeyoung. I've made a few changes to simplify the acceptance tests.

Acceptance test results

--- PASS: TestAccLicenseManagerLicenseConfiguration_disappears (27.38s)
--- PASS: TestAccLicenseManagerReceivedLicensesDataSource_empty (27.87s)
--- PASS: TestAccLicenseManagerReceivedLicenseDataSource_basic (28.33s)
--- PASS: TestAccLicenseManagerReceivedLicensesDataSource_basic (29.37s)
--- PASS: TestAccLicenseManagerLicenseConfiguration_basic (35.31s)
--- PASS: TestAccLicenseManagerLicenseConfiguration_update (56.02s)
--- PASS: TestAccLicenseManagerLicenseConfiguration_tags (73.45s)
--- PASS: TestAccLicenseManagerAssociation_disappears (106.01s)
--- PASS: TestAccLicenseManagerAssociation_basic (113.01s)
--- PASS: TestAccLicenseManagerGrant_serial (311.02s)
    --- PASS: TestAccLicenseManagerGrant_serial/grant (179.50s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/basic (41.98s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/disappears (27.45s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant/name (110.05s)
    --- PASS: TestAccLicenseManagerGrant_serial/grant_accepter (88.53s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant_accepter/basic (68.51s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant_accepter/disappears (20.02s)
    --- PASS: TestAccLicenseManagerGrant_serial/grant_data_source (42.98s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant_data_source/basic (26.63s)
        --- PASS: TestAccLicenseManagerGrant_serial/grant_data_source/empty (16.35s)

@gdavison gdavison merged commit 8555d8c into hashicorp:main Mar 9, 2023
@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Mar 9, 2023
@github-actions github-actions bot added this to the v4.58.0 milestone Mar 9, 2023
@github-actions
Copy link

This functionality has been released in v4.58.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 Apr 12, 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-data-source Introduces a new data source. new-resource Introduces a new resource. service/licensemanager Issues and PRs that pertain to the licensemanager service. size/XL 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.

New Feature: Launch AWS Marketplace produccts (AMIs, containers) in linked AWS accounts
2 participants