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

Allow empty values in Service Catalog provisioning parameters #21669

Merged
merged 4 commits into from
Nov 9, 2021

Conversation

wedge-jarrad
Copy link
Contributor

Remove check for empty value in order to allow an empty string to pass through
to the CloudFormation template.

Update tests to use provisioning parameters in order to exercise this
functionality.

Not 100% sure that adding provisioning_parameters to the ImportStateVerifyIgnore list is the right thing to do here, but modifying the resourceProvisionedProductRead function to set those values seems beyond the scope of this bug fix.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #21349

Output from acceptance testing after modifying tests but before applying the fix:

$ gmake testacc TESTARGS='-run=TestAccServiceCatalogProvisionedProduct' PKG_NAME=internal/service/servicecatalog
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/servicecatalog/... -v -count 1 -parallel 20 -run=TestAccServiceCatalogProvisionedProduct -timeout 180m
=== RUN   TestAccServiceCatalogProvisionedProduct_basic
=== PAUSE TestAccServiceCatalogProvisionedProduct_basic
=== RUN   TestAccServiceCatalogProvisionedProduct_disappears
=== PAUSE TestAccServiceCatalogProvisionedProduct_disappears
=== RUN   TestAccServiceCatalogProvisionedProduct_tags
=== PAUSE TestAccServiceCatalogProvisionedProduct_tags
=== CONT  TestAccServiceCatalogProvisionedProduct_basic
=== CONT  TestAccServiceCatalogProvisionedProduct_tags
=== CONT  TestAccServiceCatalogProvisionedProduct_disappears
=== CONT  TestAccServiceCatalogProvisionedProduct_basic
    provisioned_product_test.go:26: Step 1/2 error: Error running apply: exit status 1
        
        Error: error describing Service Catalog Provisioned Product (pp-qfufhnc642yu2): unexpected state 'ERROR', wanted target 'AVAILABLE'. last error: %!s(<nil>)
        
          with aws_servicecatalog_provisioned_product.test,
          on terraform_plugin_test.tf line 120, in resource "aws_servicecatalog_provisioned_product" "test":
         120: resource "aws_servicecatalog_provisioned_product" "test" {
        
=== CONT  TestAccServiceCatalogProvisionedProduct_disappears
    provisioned_product_test.go:72: Step 1/1 error: Error running apply: exit status 1
        
        Error: error describing Service Catalog Provisioned Product (pp-wryjotbcjnlnm): unexpected state 'ERROR', wanted target 'AVAILABLE'. last error: %!s(<nil>)
        
          with aws_servicecatalog_provisioned_product.test,
          on terraform_plugin_test.tf line 120, in resource "aws_servicecatalog_provisioned_product" "test":
         120: resource "aws_servicecatalog_provisioned_product" "test" {
        
=== CONT  TestAccServiceCatalogProvisionedProduct_tags
    provisioned_product_test.go:96: Step 1/2 error: Error running apply: exit status 1
        
        Error: error describing Service Catalog Provisioned Product (pp-cmduouhf6ta4u): unexpected state 'ERROR', wanted target 'AVAILABLE'. last error: %!s(<nil>)
        
          with aws_servicecatalog_provisioned_product.test,
          on terraform_plugin_test.tf line 120, in resource "aws_servicecatalog_provisioned_product" "test":
         120: resource "aws_servicecatalog_provisioned_product" "test" {
        
--- FAIL: TestAccServiceCatalogProvisionedProduct_basic (53.43s)
--- FAIL: TestAccServiceCatalogProvisionedProduct_disappears (53.46s)
--- FAIL: TestAccServiceCatalogProvisionedProduct_tags (56.03s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog	56.088s
FAIL
gmake: *** [GNUmakefile:28: testacc] Error 1

Tests passing after applying fix:

$ gmake testacc TESTARGS='-run=TestAccServiceCatalogProvisionedProduct' PKG_NAME=internal/service/servicecatalog
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/servicecatalog/... -v -count 1 -parallel 20 -run=TestAccServiceCatalogProvisionedProduct -timeout 180m
=== RUN   TestAccServiceCatalogProvisionedProduct_basic
=== PAUSE TestAccServiceCatalogProvisionedProduct_basic
=== RUN   TestAccServiceCatalogProvisionedProduct_disappears
=== PAUSE TestAccServiceCatalogProvisionedProduct_disappears
=== RUN   TestAccServiceCatalogProvisionedProduct_tags
=== PAUSE TestAccServiceCatalogProvisionedProduct_tags
=== CONT  TestAccServiceCatalogProvisionedProduct_basic
=== CONT  TestAccServiceCatalogProvisionedProduct_tags
=== CONT  TestAccServiceCatalogProvisionedProduct_disappears
--- PASS: TestAccServiceCatalogProvisionedProduct_disappears (132.79s)
--- PASS: TestAccServiceCatalogProvisionedProduct_basic (144.50s)
--- PASS: TestAccServiceCatalogProvisionedProduct_tags (240.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog	240.705s

Remove check for empty value in order to allow an empty string to pass through
to the CloudFormation template.

Update tests to use provisioning parameters in order to exercise this
functionality.

Fixes hashicorp#21349
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. service/servicecatalog Issues and PRs that pertain to the servicecatalog service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels Nov 8, 2021
@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Nov 8, 2021
@YakDriver YakDriver self-assigned this Nov 8, 2021
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🎉

Output from acceptance tests (GovCloud):

% TF_ACC=1 go test ./internal/service/servicecatalog -v -count 1 -parallel 20 -run='TestAccServiceCatalogProvisionedProduct' -timeout=180m
--- PASS: TestAccServiceCatalogProvisionedProduct_disappears (152.77s)
--- PASS: TestAccServiceCatalogProvisionedProduct_basic (166.79s)
--- PASS: TestAccServiceCatalogProvisionedProduct_tags (277.05s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog	278.629s

@YakDriver YakDriver added this to the v3.65.0 milestone Nov 9, 2021
@YakDriver YakDriver merged commit 112f11f into hashicorp:main Nov 9, 2021
@github-actions
Copy link

This functionality has been released in v3.65.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

github-actions bot commented Jun 9, 2022

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 Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/servicecatalog Issues and PRs that pertain to the servicecatalog service. size/S 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.

aws_servicecatalog_provisioned_product does not pass zero length provisioning_parameters
2 participants