Google Cloud Platform (GCP) Cloud Functions discovery using patterns
Summarize
Summary of Google Cloud Platform (GCP) Cloud Functions discovery using patterns
The Google Cloud Platform (GCP) - Cloud Functions discovery pattern enables ServiceNow customers to automatically discover and map Cloud Functions within their GCP deployments during horizontal discovery. This pattern is part of the Discovery and Service Mapping Patterns application and requires activation before use. It helps populate the Configuration Management Database (CMDB) with detailed information about GCP Cloud Functions and related infrastructure components.
Show less
Activation and Prerequisites
- The Cloud Functions discovery pattern is disabled by default and must be enabled manually. Starting from Visibility Content version 6.28.0, enabling or disabling patterns does not count as customization, and patterns will reset to the latest version upon upgrades while retaining their activation status.
- To use this pattern effectively, customers must meet GCP discovery prerequisites as outlined in the broader Google Cloud Platform discovery documentation.
- For the most accurate discovery results, updating the Discovery and Service Mapping Patterns application to the latest version from the ServiceNow Store may be necessary.
Data Collected by Discovery
When the GCP Cloud Functions pattern runs, it collects and stores the following key data in the CMDB:
- Cloud Service Account: Includes project account ID, object ID, and datacenter type.
- Availability Zone: Captures name, description, and state (Available or Terminated).
- Google Datacenter: Records datacenter or region name, unique GCP object ID, and descriptions.
- Cloud Function: Details include function version (Gen1 only), object ID, parsed name, last modified timestamp, code integrity hash (SHA-256), runtime language, install status (default Installed), and operational status (default Operational).
- Key Value (Tags): Tags associated with Cloud Functions are discovered and stored as key-value pairs linked to the respective Cloud Function CI.
Configuration Item (CI) Relationships
The discovery process establishes relationships among discovered CIs to provide a comprehensive dependency view:
- Google Datacenters contain Availability Zones.
- Availability Zones are hosted on Google Datacenters.
- Cloud Service Accounts host Cloud Functions.
- Cloud Functions are hosted on Google Datacenters.
- Tags (Key Value) reference Cloud Functions.
Benefits for ServiceNow Customers
By leveraging this pattern, customers can:
- Gain full visibility into GCP Cloud Functions and related infrastructure within their CMDB.
- Automatically maintain accurate and up-to-date operational and configuration data for GCP Cloud Functions.
- View dependencies and relationships in the Dependency Views map, facilitating impact analysis and change management.
- Use discovered tags to enhance filtering, reporting, and automation related to Cloud Functions.
Discovery and Service Mapping Patterns uses the Google Cloud Platform (GCP) - Cloud Functions pattern to discover Cloud Functions in a Google Cloud Platform (GCP) deployment during horizontal discovery. Discovering some of these resources may require updating to the latest version of the Discovery and Service Mapping Patterns application from the ServiceNow Store.
Pattern-based discovery and mapping requirements
- Verify the GCP discovery prerequisites
- For more information, see the prerequisites section in Google Cloud Platform (GCP) Cloud components discovery using Patterns.
- Enable the relevant pattern
- The pattern for this service is disabled by default. Starting with Visibility Content version 6.28.0, activating or deactivating a pattern won't be considered a customization, and it will continue to receive updates. Patterns that were previously activated or deactivated will reset to the latest predefined version after upgrading while retaining the last active field value. For more information on enabling patterns, see Activate a disabled pattern.
Data collected by Discovery during horizontal discovery
Discovery populates the data in the CMDB when running the Google Cloud Platform (GCP) - Cloud Functions pattern.
| Field | Description |
|---|---|
| Account Id [account_id] | Name of the project used for the discovery. |
| Object ID [object_id] | Name of the project used for the discovery. |
| Datacenter Type [datacenter_type] | Datacenter type: Google Datacenter [cmdb_ci_google_datacenter]. |
| Field | Description |
|---|---|
| Name [name] | Name of the availability zone. |
| Description [short_description] | Description of the availability zone. |
| State [state] | State of the Availability Zone. Possible values are Available or Terminated. |
| Field | Description |
|---|---|
| Name [name] | Datacenter or region name. |
| Region [region] | Datacenter or region name. |
| Object ID [object_id] | Unique identifier allocated by GCP for this resource. |
| Description [short_description] | Datacenter or region description. |
| Field | Description |
|---|---|
| Version [version] | Version ID of the function, available only for Gen1 Cloud Functions. |
| Object ID [object_id] | Name fetched from the API response. For example: projects/automation-226410/locations/us-central1/functions/auto-labeller. |
| Name [name] | Name parsed from the API response. For example: auto-labeller. |
| Function Last Modified [function_last_modified] | Timestamp indicating the last time the function was updated. |
| CodeSha256 [codesha256] | SHA-256 hash algorithm of the function's code used to verify the integrity of the build. For example: |
| Language [language] | Runtime environment or programming language used for the function. |
| Install Status [install_status] | Install status of the function. Default value is Installed. |
| Operational status [operational_status] | Operational status of the function. Default value is Operational. |
On the Dependency Views map, you can view all discovered GCP Cloud Functions resources in your organization and the relationships between them.
CI relationships
Discovery creates these relationships to support the GCP Cloud Functions discovery.
| CI | Relationship | CI |
|---|---|---|
| Google Datacenter [cmdb_ci_google_datacenter] | Contains::Contained by | Availability Zone [cmdb_ci_availability_zone] |
| Google Datacenter [cmdb_ci_google_datacenter] | Hosted on::Hosts | Cloud Service Account [cmdb_ci_cloud_service_account] |
| Cloud Function [cmdb_ci_cloud_function] | Hosted on::Hosts | Google Datacenter [cmdb_ci_google_datacenter] |
| Key Value [cmdb_key_value] | References | Cloud Function [cmdb_ci_cloud_function] |
Tag discovery
The Google Cloud Platform (GCP) - Cloud Functions pattern collects tags and populates them in the Key Value [cmdb_key_value] table.
| Field | Description |
|---|---|
| Key [key] | Tag name. |
| Value [value] | Tag value. |
| Configuration item [configuration_item] | References the Cloud Function [cmdb_ci_cloud_function] table. |