Create a catalog item from the Terraform template
Create a catalog item from the Terraform template to request cloud resource provisioning. Activated catalog items appear in the cloud user portal.
시작하기 전에
- Ensure that an appropriate Terraform config provider is available. For more information on creating the config provider, see Create a Terraform Open Source config provider and Create a Terraform Enterprise or Terraform Cloud config provider.
- Ensure that the Terraform template is working (that is, you can directly use the template with the Terraform system to provision the specified cloud resources). For more information on Terraform templates, see the Terraform language documentation.
- Ensure that the provider block of the Terraform template adheres
to the following syntax:
- Provider block syntax for the Microsoft Azure cloud:
provider "azurerm" { subscription_id = "${var.subscriptionId}" client_id = "${var.clientId}" client_secret = "${var.clientSecret}" tenant_id = "${var.tenantId}" } - Provider block syntax for the Amazon Web Services cloud:
provider "aws" { access_key = "${var.access_key}" secret_key = "${var.secret_key}" region = "${var.region}" } - Provider block syntax for Google Cloud Platform
terraform { required_providers { google = { source = "hashicorp/google" version = "5.10.0" } } } provider "google" { credentials = var.credentials project = var.project region = var.region } - Provider block syntax for VMware Cloud:
provider "vsphere" { user = "${var.user}" password = "${var.password}" vsphere_server = "${var.vsphere_server}" }주:Do not hard-code any credential in the Terraform template. Use appropriate Terraform variables to fetch the credentials from the ServiceNow AI Platform.
- Provider block syntax for the Microsoft Azure cloud:
- Ensure that the variable definition file (variable.tf, .tfvars, or .tfvars.json) contains the definition of the variables used in the provider block.
- If you are using Terraform Enterprise or Terraform Cloud, ensure that the MID Server can
connect with Version Control System (VCS) accounts provisioned in the Terraform organization. To verify connectivity with the VCS accounts provisioned in the Terraform organization, execute the appropriate curl command on the MID Server.
- GitHub
curl -H "Authorization: <API credential> https://<github-api-host>/user/repos?per_page=100&page=1"- GitLab
curl -H "Authorization: <API credential>" https://<gitlab-api-host>/api/v4/projects?visibility=private&per_page=100&page=1- Microsoft Azure DevOps
curl -H "Authorization: <API credential> https://<azure-devops-api-host>/<organization>/<project>/_apis/git/repositories?api-version=6.0"Where,- organization is the name of the Microsoft Azure DevOps organization.
- project is the name of the Microsoft Azure DevOps project.
For more information on the API credentials, see Cloud Services Catalog Terraform Connector API Key Credentials form reference.
Role required: sn_cmp.cloud_service_designer
이 태스크 정보
- string
- number
- bool
- list
- tuple
- map
- object
프로시저
-
Create a cloud catalog item.
-
Associate a Terraform template with the catalog item.
- 옵션: To add or remove catalog item form fields, edit the variable sets associated with the catalog item.
- Select the Active check box to activate the catalog item.
- Select Update.