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

aws_servicecatalog_provisioned_product does not pass zero length provisioning_parameters #21349

Closed
dboeke opened this issue Oct 18, 2021 · 2 comments · Fixed by #21669
Closed
Assignees
Labels
bug Addresses a defect in current functionality. service/servicecatalog Issues and PRs that pertain to the servicecatalog service.
Milestone

Comments

@dboeke
Copy link

dboeke commented Oct 18, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

terraform v1.09
aws provider = v3.63.0

Affected Resource(s)

  • aws_servicecatalog_provisioned_product

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_servicecatalog_provisioned_product" "tef" {
  name  = "tef"
  path_name = "Company"
  accept_language = "en"
  product_name = "Company Foundation Product"
  provisioning_artifact_name = var.tef_version
  ignore_errors = true
  
  ## Installation
  provisioning_parameters {
    key    = "InstallationDomain"
    value  = var.install_domain
  }
  provisioning_parameters {
    key    = "TurbotCertificateArn"
    value  = var.acm_cert_arn
  }
  provisioning_parameters {
    key    = "ManagedRoute53"
    value  = "Enabled"
  }
  provisioning_parameters {
    key    = "RegionCode"
    value  = "alpha"
  }
  provisioning_parameters {
    key    = "LicenseKey"
    value  = ""
  }
  provisioning_parameters {
    key    = "PredefinedVpcId"
    value  = var.vpc_id
  }
  provisioning_parameters {
    key    = "PredefinedPublicSubnetIds"
    value  = var.web_subnets
  }
  provisioning_parameters {
    key    = "PredefinedTurbotSubnetIds"
    value  = var.app_subnets
  }
  provisioning_parameters {
    key    = "PredefinedDatabaseSubnetIds"
    value  = var.db_subnets
  }
  provisioning_parameters {
    key    = "VpcAlphaRegion"
    value  = var.alpha_region
  }
  provisioning_parameters {
    key    = "VpcAlphaCidr"
    value  = var.vpc_cidr
  }
  provisioning_parameters {
    key    = "VpcBetaRegion"
    value  = ""
  }
  provisioning_parameters {
    key    = "VpcBetaCidr"
    value  = ""
  }
  provisioning_parameters {
    key    = "VpcGammaRegion"
    value  = ""
  }
  provisioning_parameters {
    key    = "VpcGammaCidr"
    value  = ""
  }
  provisioning_parameters {
    key    = "VpcBetaId"
    value  = ""
  }
  provisioning_parameters {
    key    = "VpcGammaId"
    value  = ""
  }

}

Debug Output

Panic Output

Expected Behavior

Terraform should have provisioned the service catalog product and passed all provisioning params to the api

Actual Behavior

Terraform tries to provision the product but does not send provisioning params that have empty string values, resulting in the following error:

AmazonCloudFormationException ParameterValue for ParameterKey VpcGammaCidr is required (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 1ae35ff4-9e01-499b-99ee-46e74d90ee99; Proxy: null)

Steps to Reproduce

  1. Create a Service Catalog Product that accepts blank param values
  2. Try to provision the product with terraform and pass value = "" as the value
  3. See error

Important Factoids

Empty values are often used in cloudformation as part of template logic evaluation, terraform should pass all provisioning params specified.

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/servicecatalog Issues and PRs that pertain to the servicecatalog service. labels Oct 18, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 19, 2021
wedge-jarrad added a commit to wedge-jarrad/terraform-provider-aws that referenced this issue Nov 8, 2021
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
@YakDriver YakDriver self-assigned this Nov 8, 2021
@github-actions github-actions bot added this to the v3.65.0 milestone 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

I'm going to lock this issue 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 similar to this, 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 May 30, 2022
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/servicecatalog Issues and PRs that pertain to the servicecatalog service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants