Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terraform /AWS aws_servicecatalog_portfolio

I'm trying deploy Service catalog via Terraform. When I try deploy Service catalog product by code:

#Service catalog product
resource "aws_servicecatalog_product" "linuxDesktop" {
  name  = "Linux Desktop"
  description= "Cloud development environment configured for engineering staff. Runs AWS Linux."
  owner = "IT"
  type = "CLOUD_FORMATION_TEMPLATE"

  provisioning_artifact_parameters {
    template_url = "https://fdfdasfadfdf.s3.us-west-2.amazonaws.com/development-environment.yaml"
  }
}

I got error from terraform:

aws_servicecatalog_portfolio.portfolio: Creation complete after 2s [id=port-xe2ql6s2myy3s]
╷
│ Error: error creating Service Catalog Product: InvalidParametersException: The CLOUD_FORMATION_TEMPLATE Product Type only supports the following ProvisioningArtifact Types: CLOUD_FORMATION_TEMPLATE, ACCOUNT_FACTORY
│
│   with aws_servicecatalog_product.linuxDesktop,
│   on main.tf line 31, in resource "aws_servicecatalog_product" "linuxDesktop":
│   31: resource "aws_servicecatalog_product" "linuxDesktop" {
like image 624
Martin Cholewa Avatar asked Oct 25 '25 17:10

Martin Cholewa


1 Answers

You have to add type to provisioning_artifact_parameters as well:

resource "aws_servicecatalog_product" "linuxDesktop" {
  name  = "Linux Desktop"
  description= "Cloud development environment configured for engineering staff. Runs AWS Linux."
  owner = "IT"
  type = "CLOUD_FORMATION_TEMPLATE"

  provisioning_artifact_parameters {
    template_url = "https://fdfdasfadfdf.s3.us-west-2.amazonaws.com/development-environment.yaml"
    type = "CLOUD_FORMATION_TEMPLATE"
  }
}

like image 54
Marcin Avatar answered Oct 27 '25 06:10

Marcin