Skip to content

ServiceNow Service Graph Connector for Terraform - 1.0.0 GA documentation #369

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
348e73f
Merge pull request #1 from hashicorp/main
jastr945 Jun 9, 2023
cdee891
Adding ServiceNow ServiceGraph section; redource coverage page
jastr945 May 25, 2023
09a9bab
Adding ServiceNow ServiceGraph resource coverage page
jastr945 May 25, 2023
a7432cc
ServiceNow Service Graph overview page
jastr945 May 26, 2023
e872cb6
ServiceNow Service Graph importing tags documentation
jastr945 May 26, 2023
29047da
ServiceNow Service Graph overview and setup documentation
jastr945 May 31, 2023
608bc31
ServiceNow Service Graph Connector full setup page
jastr945 Jun 5, 2023
87ffb42
ServiceNow Service Graph Connector documentation on customizations
jastr945 Jun 7, 2023
eb768c8
ServiceNow Service Graph AWS resource relationships
jastr945 Jun 8, 2023
ba670eb
ServiceNow Service Graph Azure resource relationships
jastr945 Jun 8, 2023
bade71d
ServiceNow Service Graph Google and vSphere resource relationships
jastr945 Jun 8, 2023
ebb48f5
ServiceNow Service Graph AWS field mappings
jastr945 Jun 8, 2023
1345078
ServiceNow Service Graph Google field mappings
jastr945 Jun 8, 2023
03fa405
ServiceNow Service Graph Google field mappings
jastr945 Jun 8, 2023
41db4fe
ServiceNow Service Graph Vsphere field mappings
jastr945 Jun 8, 2023
f0748cf
ServiceNow rearranging page menu depth
jastr945 Jun 8, 2023
0aaf710
Remove HTML comment
jastr945 Jun 9, 2023
64b6c0b
ServiceNow link edits
jastr945 Jun 9, 2023
21c6548
Adding resized images with correct annotations
jastr945 Jun 9, 2023
616149c
ServiceNow Service Catalog updated URLs
jastr945 Jun 9, 2023
02c37a0
Merge branch 'main' into servicenow-service-graph-basic
rkoron007 Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 44 additions & 18 deletions website/data/cloud-docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,28 +458,54 @@
"title": "Integrations",
"routes": [
{
"title": "ServiceNow Integration",
"title": "ServiceNow Integrations",
"routes": [
{ "title": "Overview", "path": "integrations/service-now" },
{
"title": "Service Catalog",
"path": "integrations/service-now/service-catalog"
},
{
"title": "Admin Guide",
"path": "integrations/service-now/admin-guide"
},
{
"title": "Developer Reference",
"path": "integrations/service-now/developer-reference"
},
{
"title": "Example Customizations",
"path": "integrations/service-now/example-customizations"
"title": "Service Catalog for Terraform",
"routes": [
{ "title": "Overview", "path": "integrations/service-now/service-catalog" },
{
"title": "Service Catalog",
"path": "integrations/service-now/service-catalog/service-catalog-config"
},
{
"title": "Admin Guide",
"path": "integrations/service-now/service-catalog/admin-guide"
},
{
"title": "Developer Reference",
"path": "integrations/service-now/service-catalog/developer-reference"
},
{
"title": "Example Customizations",
"path": "integrations/service-now/service-catalog/example-customizations"
},
{
"title": "V1 Setup Instructions",
"path": "integrations/service-now/service-catalog/service-now-v1"
}
]
},
{
"title": "V1 Setup Instructions",
"path": "integrations/service-now/service-now-v1"
"title": "Service Graph Connector for Terraform",
"routes": [
{
"title": "Overview",
"path": "integrations/service-now/service-graph"
},
{
"title": "Setup",
"path": "integrations/service-now/service-graph/service-graph-setup"
},
{
"title": "Resource Coverage",
"path": "integrations/service-now/service-graph/resource-coverage"
},
{
"title": "Customizations",
"path": "integrations/service-now/service-graph/customizations"
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ ServiceNow administrators have several options with configuring the Terraform
integration.

If you haven't yet installed the integration, see the [installation
documentation](/terraform/cloud-docs/integrations/service-now).
documentation](/terraform/cloud-docs/integrations/service-now/service-catalog).

Once the integration has been installed, you can add and customize a service
catalog and VCS repositories using the [service catalog
documentation](/terraform/cloud-docs/integrations/service-now/service-catalog).
documentation](/terraform/cloud-docs/integrations/service-now/service-catalog-config).

You can also configure how frequently ServiceNow will poll Terraform Cloud using
the documentation below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ For users who only need to order from the Terraform Catalog, we recommend
creating another role with read-only permissions for
`x_terraform_vcs_repositories` to view the available repositories for ordering
infrastructure. Install the Terraform ServiceNow Service Catalog integration by
following [the installation guide](/terraform/cloud-docs/integrations/service-now).
following [the installation guide](/terraform/cloud-docs/integrations/service-now/service-catalog).
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Items, create workspaces, and perform Terraform runs using prepared Terraform
configurations hosted in VCS repositories.

-> **Note:** The v1.x integration is deprecated, but documentation for existing
installations can be found [here](/terraform/cloud-docs/integrations/service-now/service-now-v1)
installations can be found [here](/terraform/cloud-docs/integrations/service-now/service-catalog/service-now-v1)

<!-- BEGIN: TFC:only name:pnp-callout -->
-> **Note:** The ServiceNow Catalog integration is available in Terraform Cloud **Plus** Edition. Refer to [Terraform Cloud pricing](https://www.hashicorp.com/products/terraform/pricing) for details.
Expand Down Expand Up @@ -216,21 +216,21 @@ Now that you have connected ServiceNow to Terraform Cloud, you are ready to
create a Service Catalog using the VCS repositories provided by the Terraform
Admin.

Navigate to the [Service Catalog documentation](/terraform/cloud-docs/integrations/service-now/service-catalog) to
Navigate to the [Service Catalog documentation](/terraform/cloud-docs/integrations/service-now/service-catalog-config) to
begin. You can also refer to this documentation whenever you need to add or
update request items.

### ServiceNow Developer Reference

ServiceNow developers who wish to customize the Terraform integration can refer
to the [developer documentation](/terraform/cloud-docs/integrations/service-now/developer-reference).
to the [developer documentation](/terraform/cloud-docs/integrations/service-now/service-catalog/developer-reference).

### ServiceNow Administrator's Guide.

Refer to the [ServiceNow Administrator documentation](/terraform/cloud-docs/integrations/service-now/admin-guide) for
Refer to the [ServiceNow Administrator documentation](/terraform/cloud-docs/integrations/service-now/service-catalog/admin-guide) for
information about configuring the integration.

### Example Customizations

Once the ServiceNow integration is installed, you can consult the [example
customizations documentation](/terraform/cloud-docs/integrations/service-now/example-customizations).
customizations documentation](/terraform/cloud-docs/integrations/service-now/service-catalog/example-customizations).
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ reporting the results back to ServiceNow.

Before configuring a service catalog, you must install and configure the
Terraform Cloud integration software on your ServiceNow instance. These steps
are covered in the [installation documentation](/terraform/cloud-docs/integrations/service-now).
are covered in the [installation documentation](/terraform/cloud-docs/integrations/service-now/service-catalog).

Additionally, you must have have the following information:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >-

# Terraform ServiceNow Service Catalog Integration Setup Instructions

-> **\[DEPRECATED] Integration version:** v1.1.0 (Find the latest version [here](/terraform/cloud-docs/integrations/service-now))
-> **\[DEPRECATED] Integration version:** v1.1.0 (Find the latest version [here](/terraform/cloud-docs/integrations/service-now/service-catalog))

!> **Note:** The ServiceNow Catalog integration is designed for use by Terraform Enterprise customers. We do not currently recommend using it with the SaaS version of Terraform Cloud.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
page_title: Overview - ServiceNow Service Graph Connector for Terraform Integration - instructions on customizations for admins
description: >-
ServiceNow Service Graph Connector for Terraform allows you to edit ETL mapping and add more resources.
---

# ETL Mapping Customizations

-> **ServiceNow roles:** `admin`

You can update and customize the default ETL mapping rules offered by the Service Graph Connector for Terraform.

To ensure that your custom rules remain intact during future updates, you can clone the existing ETL record and maintain it separately from the default one.

In this article, you will be guided through the process of mapping a resource using an example of an AWS virtual private network (VPC). Although this resource is already covered by the application, the principles discussed apply to any new potential resource mapping.

Any customizations should be done from the application's scope: **Service Graph Connector for Terraform**.

## Clone the ETL map

Navigate to the **IntegrationHub ETL** in the top menu. Check the **SG-Terraform** record and click **Duplicate**. Refer to the [ServiceNow documentation](https://docs.servicenow.com/en-US/bundle/utah-servicenow-platform/page/product/configuration-management/task/duplicate-cmdb-transform-map.html) on creating a duplicate of an existing ETL transform map.

## Build a resource in Terraform Cloud

Create a new workspace in your Terraform Cloud and build a Terraform resource you would like to map. It helps to have a Terraform state record of the resource to ensure accurate mapping.

[Configure a webhook](/terraform/cloud-docs/integrations/service-now/service-graph/service-graph-setup#configure-terraform-webhook) and initiate a Terraform run.

## Download Terraform State

Once the run is successfully completed, open your ServiceNow instance, click on **All** and navigate to **Scheduled Imports**.

Open the **SG-Terraform Scheduled Process State** record, search for the import set corresponding to the latest webhook request. Open it by clicking on the **Import Set** field. Wait for the import set to be successfully processed.

Since there are no existing ETL rules configured for the new resource, it is expected to be ignored during the ETL process.

Open the **Outbound Http Requests** tab, which lists the requests sent from your ServiceNow instance to Terraform Cloud in order to obtain the latest state of the workspace.

![ServiceNow Service Graph Connector Outbound Http Requests interface](/img/docs/service-now-service-graph-state-object-url.png)

Open the record which starts from "http://archivist" by clicking on the timestamp. Copy the content of the URL field and open it you your browser of through tools like Postman, which will initiate the download of the Terraform state of your resource.

Locate the resource in the state object. This JSON record will serve as a source for the future mapping.

## Identify the CI target

Pick a suitable Configuration Item (CI) target for your resource. For instance, the AWS virtual private network (VPC) resource is mapped to Cloud Network (`cmdb_ci_network`) by the Service Graph Connector for Terraform. Refer to the [ServiceNow CMDB documentation](https://docs.servicenow.com/en-US/bundle/utah-servicenow-platform/page/product/configuration-management/reference/cmdb-tables-details.html) for more details on available CI tables.

## Consult the CI Class Manager

After selecting an appropriate CI target, it is important to consult the CI Class Manager for guidance on dependent relationships. Numerous CMDB resources rely on other CI tables. If a related class is not properly mapped, the ETL job will generate errors or warnings, resulting in the failure of importing your resource into CMDB.

In the top navigation, click on **All**, search for **CI Class Manager**, and click on **Open Hierarchy**. Search for your target CI Class and check **Dependent Relationships** tab to learn more about dependent mappings required by the resource.

Example: according to the **CI Class Manager**, **Cloud Network** should be hosted on **Logical Datacenter** and **Cloud Service Account**.

## Set the mapping rules

Open the **IntegrationHub ETL** from the top navigation menu and select your cloned ETL map record prepared for customization. Refer to the [ServiceNow documentation](https://docs.servicenow.com/en-US/bundle/utah-servicenow-platform/page/product/configuration-management/concept/create-etl-transform-map.html) for a more comprehensive instruction on creating an ETL transform map.

Click on the first **Specify Basic Details** section of the ETL Transform Map Assistant. Select the import set number containing your resource from the **Sample Import Set** dropdown and click **Mark as Complete**.

Open the **Preview and Prepare Data** section and review the imported rows. Click **Mark as Complete**.

The third section provides the interface for mapping resource attributes. Click on **Select CMDB Classes to Map Source Data**. Click on **Add Conditional Class** button at the top. Set the rules that will identify your resource in the import set. Use the `type` field value from the Terraform state object to identify your resource (on the ServiceNow side, field name are prefaced with `u_`). Set the target CMDB CI CLass name and click **Save**.

![ServiceNow Service Graph Connector: setting the Conditional Class rules in the ETL mapping](/img/docs/service-now-service-graph-conditional-class-mapping.png)

To modify the mapping for your new Conditional Class record, select **Edit Mapping**. On the right side of the interface, drag the relevant data pills and drop them into the corresponding CMDB fields on the left side. Refer to the Terraform state record to verify the presence of attributes. For uniqueness, the **Source Native Key** value is typically mapped to the `arn` field when dealing with AWS resources. All resources mapped in the Service Graph Connector for Terraform will have the **Operational status** and **Name** fields populated.

![ServiceNow Service Graph Connector: mapping resource attributes in the ETL](/img/docs/service-now-service-graph-etl-attribute-mapping.png)

Once the mapping is completed, click on the left arrow at the top to return to the list of Conditional Classes. Map two more conditional classes in the same manner, according to the rules set in the CI Class Manager: **Logical Datacenter** (**AWS Datacenter** in case of AWS VPC) and **Cloud Service Account**. Since the AWS cloud provider is already covered by the application, these classes are already present. Click **Edit Class** to include your newly mapped resource into the listed conditional rules. Add another **OR** condition to each of them and click **Save**.

![ServiceNow Service Graph Connector: updating conditions on existing parent records when a new resource is mapped](/img/docs/service-now-service-graph-etl-condition-update.png)

Click **Mark as Complete** to finalize the **Select CMDB Classes to Map Source Data** section.

## Set the required relationships

Click **Add Relationships** to proceed to the next section. Click **Add Conditional Relationship** button at the top of the page. The following configuration tells the ETL that when a record with `aws_vpc` type is found in the import set, it should be hosted on **AWS Datacenter 1**. Click **Save**.

![ServiceNow Service Graph Connector: setting dependent relationships in the ETL mapping interface](/img/docs/service-now-service-graph-etl-setting-relationship.png)

A similar dependent relationship needs to be established from **AWS Datacenter** to **Cloud Service Account**. Since the AWS cloud provider is already covered by the application, the relationship record is present in the application. Click **Edit Relationship** and add another **OR** condition containing your new resource to the list. Click **Save**.

![ServiceNow Service Graph Connector: updating existing dependent relationships in the ETL mapping interface](/img/docs/service-now-service-graph-etl-editing-relationship.png)

Click **Mark as Complete** to finalize the **Add Relationships** section.

## Run a test

To test the new resource mapping, you have two options. First, you can utilize the **Test and Rollback Integration Results** interface of the ETL Transform Map Assistant. Alternatively, you can initiate a new run in your Terraform Cloud workspace that includes the deployment of the resource.
Loading