Terraform
AWS
This page details the mapping rules for importing AWS resources, provisioned with Terraform, into ServiceNow CMDB.
Mapping of Terraform resources to CMDB CI Classes
AWS resource | Terraform resource name | ServiceNow CMDB CI Class | ServiceNow CMDB Category Name |
---|---|---|---|
AWS account | N/A | cmdb_ci_cloud_service_account | Cloud Service Account |
AWS region | N/A | cmdb_ci_aws_datacenter | AWS Datacenter |
EC2 Instance | aws_instance | cmdb_ci_vm_instance | Virtual Machine Instance |
S3 Bucket | aws_s3_bucket | cmdb_ci_cloud_object_storage | Cloud Object Storage |
ECS Cluster | aws_ecs_cluster | cmdb_ci_cloud_ecs_cluster | AWS Cloud ECS Cluster |
EKS Cluster | aws_eks_cluster | cmdb_ci_kubernetes_cluster | Kubernetes Cluster |
VPC | aws_vpc | cmdb_ci_network | Cloud Network |
Database Instance (non-Aurora databases: e.g., MySQL, PostgreSQL, SQL Server, etc.) | aws_db_instance | cmdb_ci_cloud_database | Cloud DataBase |
RDS Aurora Cluster | aws_rds_cluster | cmdb_ci_cloud_db_cluster | Cloud DataBase Cluster |
RDS Aurora Instance | aws_rds_cluster_instance | cmdb_ci_cloud_database | Cloud DataBase |
DynamoDB Global Table | aws_dynamodb_global_table | cmdb_ci_dynamodb_global_table | DynamoDB Global Table |
DynamoDB Table | aws_dynamodb_table | cmdb_ci_dynamodb_table | DynamoDB Table |
Security Group | aws_security_group | cmdb_ci_compute_security_group | Compute Security Group |
Lambda | aws_lambda_function | cmdb_ci_cloud_function | Cloud Function |
Load Balancer | aws_lb | cmdb_ci_cloud_load_balancer | Cloud Load Balancer |
Tags | N/A | cmdb_key_value | Key Value |
Resource relationships
Child CI Class | Relationship type | Parent CI Class |
---|---|---|
AWS Datacenter 1 (cmdb_ci_aws_datacenter ) | Hosted On::Hosts | Cloud Service Account 1 (cmdb_ci_cloud_service_account ) |
AWS Datacenter 2 (cmdb_ci_aws_datacenter ) | Hosted On::Hosts | Cloud Service Account 6 (cmdb_ci_cloud_service_account ) |
Virtual Machine Instance 1 (cmdb_ci_vm_instance ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Virtual Machine Instance 1 (cmdb_ci_vm_instance ) | Reference | Key Value 1 (cmdb_key_value ) |
AWS Cloud ECS Cluster 1 (cmdb_ci_cloud_ecs_cluster ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
AWS Cloud ECS Cluster 1 (cmdb_ci_cloud_ecs_cluster ) | Reference | Key Value 2 (cmdb_key_value ) |
Cloud Object Storage 1 (cmdb_ci_cloud_object_storage ) | Hosted On::Hosts | AWS Datacenter 2 (cmdb_ci_aws_datacenter ) |
Cloud Object Storage 1 (cmdb_ci_cloud_object_storage ) | Reference | Key Value 3 (cmdb_key_value ) |
Kubernetes Cluster 1 (cmdb_ci_kubernetes_cluster ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Kubernetes Cluster 1 (cmdb_ci_kubernetes_cluster ) | Reference | Key Value 4 (cmdb_key_value ) |
Cloud Network 1 (cmdb_ci_network ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Cloud Network 1 (cmdb_ci_network ) | Reference | Key Value 5 (cmdb_key_value ) |
Cloud DataBase 1 (cmdb_ci_cloud_database ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Cloud DataBase 1 (cmdb_ci_cloud_database ) | Reference | Key Value 6 (cmdb_key_value ) |
Cloud DataBase Cluster 1 (cmdb_ci_cloud_db_cluster ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Cloud DataBase Cluster 1 (cmdb_ci_cloud_db_cluster ) | Reference | Key Value 7 (cmdb_key_value ) |
DynamoDB Global Table 1 (cmdb_ci_dynamodb_global_table ) | Hosted On::Hosts | Cloud Service Account 1 (cmdb_ci_cloud_service_account ) |
DynamoDB Table 1 (cmdb_ci_dynamodb_table ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
DynamoDB Table 1 (cmdb_ci_dynamodb_table ) | Reference | Key Value 8 (cmdb_key_value ) |
Compute Security Group 1 (cmdb_ci_compute_security_group ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Compute Security Group 1 (cmdb_ci_compute_security_group ) | Reference | Key Value 10 (cmdb_key_value ) |
Cloud Function 1 (cmdb_ci_cloud_function ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Cloud Function 1 (cmdb_ci_cloud_function ) | Reference | Key Value 11 (cmdb_key_value ) |
Cloud Load Balancer 1 (cmdb_ci_cloud_load_balancer ) | Hosted On::Hosts | AWS Datacenter 1 (cmdb_ci_aws_datacenter ) |
Cloud Load Balancer 1 (cmdb_ci_cloud_load_balancer ) | Reference | Key Value 12 (cmdb_key_value ) |
Field attributes mapping
Cloud Service Account (cmdb_ci_cloud_service_account
)
CMDB field | Terraform state field |
---|---|
Source Native Key | Resource account number extracted from arn |
Account Id | Resource account number extracted from arn |
Datacenter Type | Resource cloud provider extracted from arn |
Object ID | Resource id extracted from arn |
Name | Resource name extracted from arn |
Operational Status | Defaults to "1" ("Operational") |
AWS Datacenter (cmdb_ci_aws_datacenter
)
CMDB field | Terraform state field |
---|---|
Source Native Key | Concatenation of region and account number extracted from arn |
Object Id | Region extracted from arn |
Region | Region extracted from arn |
Name | Region extracted from arn |
Operational Status | Defaults to "1" ("Operational") |
Virtual Machine Instance (cmdb_ci_vm_instance
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Placement Group ID | placement_group |
IP Address | public_ip |
Status | instance_state |
VM Instance ID | id |
Name | id |
State | state |
CPU | cpu_core_count |
Operational Status | Defaults to "1" ("Operational") |
AWS Cloud ECS Cluster (cmdb_ci_cloud_ecs_cluster
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
Cloud Object Storage (cmdb_ci_cloud_object_storage
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Cloud Provider | Resource cloud provider extracted from arn |
Name | bucket |
Operational Status | Defaults to "1" ("Operational") |
Kubernetes Cluster (cmdb_ci_kubernetes_cluster
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
IP Address | endpoint |
Port | Defaults to "6443" |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
Cloud Network (cmdb_ci_network
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
Cloud DataBase (cmdb_ci_cloud_database
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Version | engine_version |
Type | engine |
TCP port(s) | port |
Category | instance_class |
Fully qualified domain name | endpoint |
Location | Region extracted from arn |
Name | name |
Vendor | Resource cloud provider extracted from arn |
Operational Status | Defaults to "1" ("Operational") |
Cloud DataBase Cluster (cmdb_ci_cloud_db_cluster
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Cluster ID | cluster_resource_id |
Name | name |
TCP port(s) | port |
Fully qualified domain name | endpoint |
Vendor | Resource cloud provider extracted from arn |
Operational Status | Defaults to "1" ("Operational") |
DynamoDB Table (cmdb_ci_dynamodb_table
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | arn |
Location | Region extracted from arn |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
DynamoDB Global Table (cmdb_ci_dynamodb_global_table
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | arn |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
Compute Security Group (cmdb_ci_compute_security_group
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Location | Region extracted from arn |
Name | name |
Operational Status | Defaults to "1" ("Operational") |
Cloud Function (cmdb_ci_cloud_function
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | arn |
Language | runtime |
Code Size | source_code_size |
Location | Region extracted from arn |
Name | function_name |
Operational Status | Defaults to "1" ("Operational") |
Cloud Load Balancer (cmdb_ci_cloud_load_balancer
)
CMDB field | Terraform state field |
---|---|
Source Native Key | arn |
Object Id | id |
Canonical Hosted Zone Name | dns_name |
Canonical Hosted Zone ID | zone_id |
Location | Region extracted from arn |
Name | name |
Operational Status | Defaults to "1" ("Operational") |