我正在尝试通过Terraform部署服务目录。当我尝试按代码部署服务目录产品时:
#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"
}
}
我从地形中得到错误:
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" {
您还必须向provisioning_artifact_parameters
添加类型:
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"
}
}