hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.85k stars 9.2k forks source link

[Docs]: #31601

Closed goural closed 10 months ago

goural commented 1 year ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/servicecatalog_product

Description

Here in provisioning_artifact_parameters it is given that type is optional value, however it is required value as without passing it the terraform throws error .

terraform resource code -

resource "aws_servicecatalog_product" "s3product" {
  name  = "Simple S3 bucket"
  owner = "IT"
  type  = "TERRAFORM_OPEN_SOURCE"
  provisioning_artifact_parameters {
    template_url = "template url here"
  }
  tags = var.tags
}

ERROR -

│ Error: creating Service Catalog Product: InvalidParametersException: The TERRAFORM_OPEN_SOURCE Product Type only supports the following ProvisioningArtifact Types: TERRAFORM_OPEN_SOURCE
│ 
│   with aws_servicecatalog_product.s3product,
│   on main.tf line 8, in resource "aws_servicecatalog_product" "s3product":
│    8: resource "aws_servicecatalog_product" "s3product" {
│ 

Document Ref - type - (Optional) Type of provisioning artifact. See AWS Docs for valid list of values.

Code that works -

resource "aws_servicecatalog_product" "s3product" {
  name  = "Simple S3 bucket"
  owner = "IT"
  type  = "TERRAFORM_OPEN_SOURCE"

  provisioning_artifact_parameters {
    template_url = "template url here"
    type                        = "TERRAFORM_OPEN_SOURCE"
  }

  tags = var.tags
}

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 1 year ago

Hey @goural 👋 Thank you for taking the time to raise this! I took a look at the schema and both the AWS Go SDK documentation and AWS API documentation, all of which point to this being an optional argument.

It appears this is one of those cases where it's required for some configurations, but not all. With that in mind, it appears that the documentation (and current schema behavior) are correct.

github-actions[bot] commented 9 months ago

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.